Re: Passing args

2003-01-11 Thread Mike Vanecek
-- Original Message --- From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Sat, 11 Jan 2003 16:34:40 -0800 (PST) Subject: Re: Passing args > On Sat, 11 Jan 2003, Mike Vanecek wrote: > > > I just did a default install which was

Re: Passing args

2003-01-11 Thread Todd A. Jacobs
On Sat, 11 Jan 2003, Mike Vanecek wrote: > I just did a default install which was bash. How and where would I > change to bash2? /usr/bin/chsh -s /bin/bash2 -- "Of course I'm in shape! Round's a shape, isn't it?" -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsu

Re: Passing args

2003-01-11 Thread Mike Vanecek
-- Original Message --- From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Sat, 11 Jan 2003 15:37:50 -0800 (PST) Subject: Re: Passing args > On Sat, 11 Jan 2003, Mike Vanecek wrote: > > > [root@www root]# type gedx > > bash:

Re: Passing args

2003-01-11 Thread Mike Vanecek
Thank you, thank you, thank you. -- Original Message --- From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Sat, 11 Jan 2003 15:36:06 -0800 (PST) Subject: Re: Passing args > On Sat, 11 Jan 2003, Mike Vanecek wrote: > > > ./d

Re: Passing args

2003-01-11 Thread Todd A. Jacobs
On Sat, 11 Jan 2003 [EMAIL PROTECTED] wrote: > should that be "gedit $1 && shift;" ? No, the single "&" is tokenized by the shell as both the job backgrounder and a command separator (e.g. ";"). The shell often compresses functions like this, presumably to save RAM. The double ampersand is th

Re: Passing args

2003-01-11 Thread Robert P. J. Day
On Sat, 11 Jan 2003, Mike Vanecek wrote: > [root@www root]# ./getfun > Profile executed $ . ./getfun rday -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list

Re: Passing args

2003-01-11 Thread Todd A. Jacobs
On Sat, 11 Jan 2003, Mike Vanecek wrote: > [root@www root]# type gedx > bash: type: gedx: not found See my previous post. Source the script, don't execute it. And use bash2 instead of bash; there's rarely a good reason not to do so. -- "Of course I'm in shape! Round's a shape, isn't it?" -

Re: Passing args

2003-01-11 Thread Todd A. Jacobs
On Sat, 11 Jan 2003, Mike Vanecek wrote: > ./dummy Don't do this. Use "source dummy" instead. Bash (instead of bash2) isn't putting the function into the current shell when you execute it. Whatever the reason, why not just avoid all the fuss? Create ged somewhere in your path as a script, chmo

Re: Passing args

2003-01-11 Thread Mike Vanecek
Todd, here are the results of my run: [root@www root]# cat getfun # ed is a real program, so use something else to avoid confusion. # Usage: ged function gedx { while [[ $1 ]]; do gedit $1 & shift done } function gedz { while [[ -n $1 ]]; do gedit $1 & shift

Re: Passing args

2003-01-11 Thread rpjday
On Sat, 11 Jan 2003 17:08:40 -0600 Mike Vanecek <[EMAIL PROTECTED]> wrote: > > while [[ -n $1 ]]; do > > gedit $1 & shift; should that be "gedit $1 && shift;" ? ^^ rday -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscrib

Re: Passing args

2003-01-11 Thread Mike Vanecek
Thanks for the response, but ... -- Original Message --- From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Sat, 11 Jan 2003 14:03:31 -0800 (PST) Subject: Re: Passing args > This doesn't look right. The brackets are too close, and

Re: Passing args

2003-01-11 Thread Todd A. Jacobs
On Fri, 10 Jan 2003, Mike Vanecek wrote: > ged () > { > while [[$1]]; do > gedit $1 & shift; > done > } This doesn't look right. The brackets are too close, and will not be properly tokenized. On my system: $ type ged ged is a function ged () { while [[

Re: Passing args

2003-01-10 Thread Mike Vanecek
Uhm, shouldn't you be in bed by now . Thank you for the response, but I still cannot get it to work on a RH 8 machine. -- Original Message --- From: Mad Hatter <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Fri, 10 Jan 2003 22:06:48 -0800 (PST) Subject: Re: Passing

Re: Passing args

2003-01-10 Thread Mad Hatter
hought that since it would > not work. > > > -- Original Message --- > From: "Todd A. Jacobs" <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Sent: Fri, 10 Jan 2003 18:41:30 -0800 (PST) > Subject: Re: Passing args > > > On Fri, 10 Jan 200

Re: Passing args

2003-01-10 Thread Mike Vanecek
OK, no positional parameters in an alias; sorta thought that since it would not work. -- Original Message --- From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Fri, 10 Jan 2003 18:41:30 -0800 (PST) Subject: Re: Passing args > On Fri

Re: Passing args

2003-01-10 Thread Mike Vanecek
-- Original Message --- From: j_post <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Fri, 10 Jan 2003 17:55:31 -0800 Subject: Re: Passing args > On Friday 10 January 2003 05:37 pm, you wrote: > > The answer to this is probably so easy ... > > > > I w

Re: Passing args

2003-01-10 Thread Todd A. Jacobs
On Fri, 10 Jan 2003, Mike Vanecek wrote: > I want to be in a terminal and type ed filename and have the editor open and > start editing filename in the background. You can't use positional parameters in an alias; you need to use a function instead: # ed is a real program, so use something

Re: Passing args

2003-01-10 Thread j_post
On Friday 10 January 2003 05:37 pm, you wrote: > The answer to this is probably so easy ... > > I want to be in a terminal and type ed filename and have the editor open > and start editing filename in the background. > > Easy, put an alias in /etc/profile > > alias ed="gedit $1 & " <--- this one

Passing args

2003-01-10 Thread Mike Vanecek
The answer to this is probably so easy ... I want to be in a terminal and type ed filename and have the editor open and start editing filename in the background. Easy, put an alias in /etc/profile alias ed="gedit $1 & " alias ed="gedit $%1 & " alias ed="gedit %$1 & " alias ed="gedit %1 & " W