\!:1 \!*
etc.), then in zsh you need a function (referencing $1 $*
etc.). Otherwise, you can use a zsh alias.
$*
in the body (inside the { }
).
Parameters don't magically appear inside the { }
the way they get appended to an alias.
alias rm "rm
-i"
), then in a zsh function you need the
command
keyword (function rm() { command rm -i $*
}
), but in a zsh alias you don't (alias rm="rm
-i"
).
alias ls "ls -C"
;
alias lf "ls -F"
==> lf == ls -C -F
)
then you must either:
.zshrc
defines
all of your aliases before it defines any of your functions.
csh | zsh |
---|---|
\!*
|
$* (or $argv )
|
\!^
|
$1 (or $argv[1] )
|
\!:1
|
$1
|
\!:2
|
$2 (or $argv[2]) , etc.)
|
\!$
|
$*[$#] (or $argv[$#] , or $*[-1] )
|
\!:1-4
|
$*[1,4]
|
\!:1-
|
$*[1,$#-1] (or $*[1,-2] )
|
\!^-
|
$*[1,$#-1]
|
\!*:q
|
"$@" ($*:q doesn't work (yet))
|
\!*:x
|
$=* ($*:x doesn't work (yet))
|
$1, $2
, etc.) greater than the
number of parameters. (E.g., in a csh alias, a reference to
\!:5
will cause an error if 4 or fewer arguments are
given; in a zsh function, $5
is the empty string if
there are 4 or fewer parameters.)
-
(dash, hyphen)
character, use alias --
:
csh | zsh |
---|---|
alias - "fg %-"
|
alias -- -="fg %-"
|
alias -g
in zsh until you
REALLY know what you're doing.