Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: about alias



"Zhong, Kaixiang" <kzhong@xxxxxxxxxxx> writes:

> I wonder if there is a easy way to use original command instead of
> using alias or functions temporarily in zsh.  E.g:
> 
> I defined rm as 
> rm() {
> 	mv $* ~/.wastebaseket
> }
> 
> However sometimes I just want to use /bin/rm temporarily. 
> I know I can do that in csh by using "\rm".  But this don't work in
> zsh.

It works in Zsh for aliases, too.  For functions, you should use
`command':

command rm something.

If you really want to use \, you can do something like this:

my_rm() {
  mv "$@" ~/.wastebasket
}
alias rm=my_rm

Now `rm' will normally call the function `my_rm', and `\rm' will
circumvent the alias, and call the command `rm'.

-- 
Hrvoje Niksic <hniksic@xxxxxxx> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
main(){printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}



Messages sorted by: Reverse Date, Date, Thread, Author