-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2142
koalaman edited this page Jan 20, 2018
·
6 revisions
alias archive='mv "$@" /backup'
archive() { mv "$@" /backup; }
Aliases just substitute the start of a command with something else. They therefore can't use positional parameters, such as $1
. Rewrite your alias as a function.
If your alias ends up quoting the value, e.g. alias cut_first="awk '{print \$1}'"
, you can technically ignore this error. However, you should consider turning this alias into a more readable function instead: cut_first() { awk '{print $1}' "$@"; }