In comp.unix.shell, Ottavio Caruso <
[email protected]> 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 [email protected] -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
[email protected] -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
[email protected] -p password
$ e yt _auth _native
/home/user/bin/yt-dlp -u
[email protected] -p password --hls-prefer-native
$
But seriously, write a wrapper script.
Elijah
------
includes preferred destination directory and site-based rules in his
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)