On Mon, May 01, 2006 at 09:35:27AM +0300, Erez D wrote:
> hi
> 
> i have in csh:
> alias vi 'gvim \!* &'
> 
> i tryed translating to bash as
> 
> alias vi='gvim $* &'
> 
> this works without the ampersand, bit not with it

aliases are replacement text, not scripts. whatever you set in your alias 
will be written as is, as if you wrote it manually. so you're basically 
typing:

$ vi bla
=>
$ gvim $* & bla

> or
> 
> vi() {gvim $* & ; }

the ';' is redundant, even possibly illegal.
And you always want "$@", almost never $*.
So

vi(){gvim "$@" &}

- ods15

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to