zsh-users
 help / color / mirror / code / Atom feed
* about alias
@ 1997-05-29 17:50 Zhong, Kaixiang
  1997-05-29 17:57 ` Hrvoje Niksic
  1997-05-29 19:16 ` Wayne Davison
  0 siblings, 2 replies; 3+ messages in thread
From: Zhong, Kaixiang @ 1997-05-29 17:50 UTC (permalink / raw)
  To: 'zsh-users@math.gatech.edu'

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.

thanks,

Kai,
========================================================
  Kai (Kaixiang) Zhong      Phone: (617) 923-6669
  Software Engineer         Fax:   (617) 923-5169
  OneWave, Inc.               or   (617) 923-6565
  1 Arsenal Marketplace,    http://www.onewave.com
  Watertown, MA, 02172      Email: kzhong@onewave.com
========================================================


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: about alias
  1997-05-29 17:50 about alias Zhong, Kaixiang
@ 1997-05-29 17:57 ` Hrvoje Niksic
  1997-05-29 19:16 ` Wayne Davison
  1 sibling, 0 replies; 3+ messages in thread
From: Hrvoje Niksic @ 1997-05-29 17:57 UTC (permalink / raw)
  To: Zhong, Kaixiang; +Cc: 'zsh-users@math.gatech.edu'

"Zhong, Kaixiang" <kzhong@onewave.com> 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@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
main(){printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: about alias
  1997-05-29 17:50 about alias Zhong, Kaixiang
  1997-05-29 17:57 ` Hrvoje Niksic
@ 1997-05-29 19:16 ` Wayne Davison
  1 sibling, 0 replies; 3+ messages in thread
From: Wayne Davison @ 1997-05-29 19:16 UTC (permalink / raw)
  To: Zhong, Kaixiang; +Cc: 'zsh-users@math.gatech.edu'

"Zhong, Kaixiang" writes:
> However sometimes I just want to use /bin/rm temporarily. 
> I know I can do that in csh by using "\rm".

One solution is to type "=rm", which expands the path to rm for you,
bypassing the alias.

..wayne..


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-05-29 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-29 17:50 about alias Zhong, Kaixiang
1997-05-29 17:57 ` Hrvoje Niksic
1997-05-29 19:16 ` Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).