Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Many Myths are based on truth -- Spock, "The Way to Eden", stardate 5832.3


devel / comp.unix.shell / Bash - Can I create cascading aliases, that is an alias of an alias?

SubjectAuthor
* Bash - Can I create cascading aliases, that is an alias of an alias?Ottavio Caruso
+- Re: Bash - Can I create cascading aliases, that is an alias of anFenris
+- Re: Bash - Can I create cascading aliases, that is an alias of anChris Elvidge
`* Re: Bash - Can I create cascading aliases, that is an alias of an alias?Eli the Bearded
 +- Re: Bash - Can I create cascading aliases, that is an alias of anJanis Papanagnou
 `* Re: Bash - Can I create cascading aliases, that is an alias of anOttavio Caruso
  `* Re: Bash - Can I create cascading aliases, that is an alias of anDavid W. Hodgins
   `- Re: Bash - Can I create cascading aliases, that is an alias of anOttavio Caruso

1
Bash - Can I create cascading aliases, that is an alias of an alias?

<t4gtkh$kdb$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5277&group=comp.unix.shell#5277

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ottavio2...@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Bash - Can I create cascading aliases, that is an alias of an alias?
Date: Fri, 29 Apr 2022 15:44:32 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <t4gtkh$kdb$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Apr 2022 14:44:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="57617bd1d5e16e9f4482b7c58051f788";
logging-data="20907"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PYvMb59HFzxesFoL4+9EZm07WLLGwJbs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.0.3
Cancel-Lock: sha1:CuZJC4OPDjDFIV+34vxLw82ea4U=
X-No-Archive: yes
Content-Language: en-GB
 by: Ottavio Caruso - Fri, 29 Apr 2022 14:44 UTC

Hi,

Assuming:

alias yt='/home/user/bin/yt-dlp'

and I want have more aliases incorporating this alias:

alias yt-native='yt --hls-prefer-native"
alias alias yt-auth='yt -u user@email.com -p password"

so that I don't have to repeat the location of yt-dlp.

Is that possible?

--
Ottavio Caruso

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<slrnt6o3l7.879.fenris@rie.sdf.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5278&group=comp.unix.shell#5278

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!0uS3IkI3e3DfmX4suNwhhQ.user.46.165.242.75.POSTED!not-for-mail
From: fen...@invalid.invalid (Fenris)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an
alias?
Date: Fri, 29 Apr 2022 16:13:28 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <slrnt6o3l7.879.fenris@rie.sdf.org>
References: <t4gtkh$kdb$1@dont-email.me>
Injection-Info: gioia.aioe.org; logging-data="26302"; posting-host="0uS3IkI3e3DfmX4suNwhhQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: slrn/1.0.3 (Patched for libcanlock3) (NetBSD)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Fenris - Fri, 29 Apr 2022 16:13 UTC

On 2022-04-29, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> Assuming:
>
> alias yt='/home/user/bin/yt-dlp'
>
> and I want have more aliases incorporating this alias:
>
> alias yt-native='yt --hls-prefer-native"
> alias alias yt-auth='yt -u user@email.com -p password"
>
> so that I don't have to repeat the location of yt-dlp.
>
> Is that possible?

So why don't you just try it?

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<t4hbod$dbl$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5279&group=comp.unix.shell#5279

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: chr...@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an
alias?
Date: Fri, 29 Apr 2022 19:45:33 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <t4hbod$dbl$1@dont-email.me>
References: <t4gtkh$kdb$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Apr 2022 18:45:34 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0fb8c0ee1b1790be54fae438c49db22e";
logging-data="13685"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FkC/4JHxbXMzhx8g4AQ423HhRfZ8xpQM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:XbBSabIm2cYxX2CfljiQUipSxXU=
In-Reply-To: <t4gtkh$kdb$1@dont-email.me>
Content-Language: en-GB
 by: Chris Elvidge - Fri, 29 Apr 2022 18:45 UTC

On 29/04/2022 15:44, Ottavio Caruso wrote:
> Hi,
>
> Assuming:
>
> alias yt='/home/user/bin/yt-dlp'
>
> and I want have more aliases incorporating this alias:
>
> alias yt-native='yt --hls-prefer-native"
> alias alias yt-auth='yt -u user@email.com -p password"
>
> so that I don't have to repeat the location of yt-dlp.
>
> Is that possible?
>

You type this _once_ into your .bash_aliases!
You could even repeat lines. Too much trouble?
Or are you just trolling?

--
Chris Elvidge
England

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<eli$2204292056@qaz.wtf>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5280&group=comp.unix.shell#5280

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *...@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an alias?
Date: Sat, 30 Apr 2022 01:13:24 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2204292056@qaz.wtf>
References: <t4gtkh$kdb$1@dont-email.me>
Injection-Date: Sat, 30 Apr 2022 01:13:24 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="12613"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Sat, 30 Apr 2022 01:13 UTC

In comp.unix.shell, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> Hi,
>
> Assuming:
>
> alias yt='/home/user/bin/yt-dlp'
>
> and I want have more aliases incorporating this alias:
>
> alias yt-native='yt --hls-prefer-native"
> alias alias yt-auth='yt -u user@email.com -p password"

Yes. I'd say that method sucks, however. Personally I use a wrapper
script for yt-dlp that sets my preferred options and gives me handy
command line shortcuts.

But you can do some fun stuff with aliases.

When an alias definition ends with a space, the following term can also
be an alias. The typical use-case is an alias with nice, time, sudo or
the like that you would prefix to a regular comandline.
It can also be used to rename options.

alias yt='/home/user/bin/yt-dlp '
alias _native='--hls-prefer-native '
alias _auth='-u user@email.com -p password '
alias e='echo '

Now you can chain them, and order doesn't matter.

$ e yt _native _auth
/home/user/bin/yt-dlp --hls-prefer-native -u user@email.com -p password
$ e yt _auth _native
/home/user/bin/yt-dlp -u user@email.com -p password --hls-prefer-native
$

But seriously, write a wrapper script.

Elijah
------
includes preferred destination directory and site-based rules in his

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<t4ib31$5em$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5281&group=comp.unix.shell#5281

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an
alias?
Date: Sat, 30 Apr 2022 05:40:17 +0200
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <t4ib31$5em$1@dont-email.me>
References: <t4gtkh$kdb$1@dont-email.me> <eli$2204292056@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Apr 2022 03:40:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="46285cb07f1550aa785bffb4ff13b56a";
logging-data="5590"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZDC5Vgm8Qsj+gVd5K+lr2"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:LRqploQ9AH1swi/rJN7DXkbv4S0=
In-Reply-To: <eli$2204292056@qaz.wtf>
 by: Janis Papanagnou - Sat, 30 Apr 2022 03:40 UTC

On 30.04.2022 03:13, Eli the Bearded wrote:
> In comp.unix.shell, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>> Hi,
>>
>> Assuming:
>>
>> alias yt='/home/user/bin/yt-dlp'
>>
>> and I want have more aliases incorporating this alias:
>>
>> alias yt-native='yt --hls-prefer-native"
>> alias alias yt-auth='yt -u user@email.com -p password"
>
> [...]
>
> But seriously, write a wrapper script.

Or just use shell functions to avoid the restrictions of aliases and
get the advantages of both.

Janis

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<t4j0g6$hp1$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5282&group=comp.unix.shell#5282

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ottavio2...@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an
alias?
Date: Sat, 30 Apr 2022 10:45:40 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <t4j0g6$hp1$1@dont-email.me>
References: <t4gtkh$kdb$1@dont-email.me> <eli$2204292056@qaz.wtf>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Apr 2022 09:45:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5e5fa0dfafdcc9874adf68f160ea7938";
logging-data="18209"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bPWGMDOwG7tHdr3rSzqsm4dwNc37avuk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.0.3
Cancel-Lock: sha1:gW1oG8m0syd8S0ySXpgj5aezRpM=
X-No-Archive: yes
In-Reply-To: <eli$2204292056@qaz.wtf>
Content-Language: en-GB
 by: Ottavio Caruso - Sat, 30 Apr 2022 09:45 UTC

On 30/04/2022 02:13, Eli the Bearded wrote:
> In comp.unix.shell, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
>> Hi,
>>
>> Assuming:
>>
>> alias yt='/home/user/bin/yt-dlp'
>>
>> and I want have more aliases incorporating this alias:
>>
>> alias yt-native='yt --hls-prefer-native"
>> alias alias yt-auth='yt -u user@email.com -p password"
>
> Yes. I'd say that method sucks, however. Personally I use a wrapper
> script for yt-dlp that sets my preferred options and gives me handy
> command line shortcuts.
>
> But you can do some fun stuff with aliases.
>
> When an alias definition ends with a space, the following term can also
> be an alias.

Ah, thanks. That's the one I was looking for. It's buried somewhere in
the man page (hints are welcome) but I can't find it. However...

> But seriously, write a wrapper script.

I agree.

--
Ottavio Caruso

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<op.1lf7jhoga3w0dxdave@hodgins.homeip.net>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5283&group=comp.unix.shell#5283

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dwhodg...@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an
alias?
Date: Sat, 30 Apr 2022 13:15:07 -0400
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <op.1lf7jhoga3w0dxdave@hodgins.homeip.net>
References: <t4gtkh$kdb$1@dont-email.me> <eli$2204292056@qaz.wtf>
<t4j0g6$hp1$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="272ff4d5cc1af932657829d45279b4f2";
logging-data="3003"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WwLi0jo5ISNXshbxvTiT9qBUVwcP5WnQ="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:++bMJnzyPxhDIBrxGcQoZh8AbUA=
 by: David W. Hodgins - Sat, 30 Apr 2022 17:15 UTC

On Sat, 30 Apr 2022 05:45:40 -0400, Ottavio Caruso <ottavio2006-usenet2012@yahoo.com> wrote:
> Ah, thanks. That's the one I was looking for. It's buried somewhere in
> the man page (hints are welcome) but I can't find it. However...

In GNU bash, version 5.1.4(1)-release the text in "man bash", the first paragraph
in the ALIASES section ends with ...

If the last character of the alias value is a blank, then the next command
word following the alias is also checked for alias expansion.

Regards, Dave Hodgins

Re: Bash - Can I create cascading aliases, that is an alias of an alias?

<t4qs3p$ndl$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5288&group=comp.unix.shell#5288

 copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ottavio2...@yahoo.com (Ottavio Caruso)
Newsgroups: comp.unix.shell
Subject: Re: Bash - Can I create cascading aliases, that is an alias of an
alias?
Date: Tue, 3 May 2022 10:19:51 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <t4qs3p$ndl$1@dont-email.me>
References: <t4gtkh$kdb$1@dont-email.me> <eli$2204292056@qaz.wtf>
<t4j0g6$hp1$1@dont-email.me> <op.1lf7jhoga3w0dxdave@hodgins.homeip.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 3 May 2022 09:19:53 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e52fd2ca31cbd490fd7234e4919cc824";
logging-data="23989"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4QpR6z0HmsEYjSqL2P5HXjAAlISmMSP4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.0.3
Cancel-Lock: sha1:R1F+7j2PCHlgVk6+SRXL5BrHyrY=
X-No-Archive: yes
In-Reply-To: <op.1lf7jhoga3w0dxdave@hodgins.homeip.net>
Content-Language: en-GB
 by: Ottavio Caruso - Tue, 3 May 2022 09:19 UTC

On 30/04/2022 18:15, David W. Hodgins wrote:
> On Sat, 30 Apr 2022 05:45:40 -0400, Ottavio Caruso
> <ottavio2006-usenet2012@yahoo.com> wrote:
>> Ah, thanks. That's the one I was looking for. It's buried somewhere in
>> the man page (hints are welcome) but I can't find it. However...
>
> In GNU bash, version 5.1.4(1)-release the text in "man bash", the first
> paragraph
> in the ALIASES section ends with ...
>
> If the last character of the alias value is a blank, then the next command
>        word following the alias is also checked for alias expansion.
>
> Regards, Dave Hodgins

Thanks.

--
Ottavio Caruso

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor