2 ms·
Functions are great. Aliases are no replacement for them since every time you'd use one, the arguments are likely to be different. Here are a few examples I use
by ksaj 4y ago
Functions are great. Aliases are no replacement for them since every time you'd use one, the arguments are likely to be different. Here are a few examples I use for WSL:
pbpaste () {
powershell.exe -noprofile -command Get-Clipboard
}
pbcopy () {
clip.exe < "${1:-/dev/stdin}"
}
yt () {
youtube-dl -fmp4 --no-check-certificate `pbpaste`
}
None of these would work as aliases, unless you only want them to keep doing whatever they did in the first invocation every time thereafter. Eg: as an alias, yt would be limited to downloading the same video over and over again.