From repett0 at sweb.uky.edu Fri Jun 1 14:09:38 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: command line Message-ID: how do you get command line args in a perl script myscript -a asdf -b fdsa etc Thanks Ron From soward at uky.edu Fri Jun 1 14:14:11 2001 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: command line References: Message-ID: <3B17E983.80108@uky.edu> Ronald Edward Petty wrote: >how do you get command line args in a perl script > >myscript -a asdf -b fdsa etc > they'll be in @ARGV or you can use the Getopt module(s) see http://cpan.uky.edu/ and look for getopt. -- John Soward Lead Systems Programmer, Technical Services, University of Kentucky p: 859.257.2900x298 e:soward@uky.edu w: http://neworder.cc.uky.edu/ From repett0 at sweb.uky.edu Fri Jun 1 14:26:41 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: command line In-Reply-To: <3B17E983.80108@uky.edu> Message-ID: I was pretty off there.. I meant getopt , I can do argv... so thanks for the reminder... Ron On Fri, 1 Jun 2001, John Soward wrote: > Ronald Edward Petty wrote: > > >how do you get command line args in a perl script > > > >myscript -a asdf -b fdsa etc > > > they'll be in @ARGV > > or you can use the Getopt module(s) > > see http://cpan.uky.edu/ and look for getopt. > > -- > John Soward > Lead Systems Programmer, Technical Services, University of Kentucky > p: 859.257.2900x298 e:soward@uky.edu w: http://neworder.cc.uky.edu/ > > > > > From repett0 at sweb.uky.edu Thu Jun 21 15:58:56 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: back tick problem Message-ID: $t = `$argv[0]`; $t2 = `$t`; If argv[0] is command that produces another commane newfs .... will make mkfs ..... and the `$t` executes.... why is the output of that $2 null even though it is scrolling on the screen and correct? Ron From rbowen at rcbowen.com Thu Jun 21 16:11:44 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: back tick problem In-Reply-To: References: Message-ID: <200106212111.f5LLBna03115@rhiannon.rcbowen.com> On Thu, 21 Jun 2001 16:58:56 -0400 (EDT), Ronald Edward Petty said: > > $t = `$argv[0]`; > $t2 = `$t`; > > If argv[0] is command that produces another commane > newfs .... will make mkfs ..... > > and the `$t` executes.... why is the output of that $2 null even though it > is scrolling on the screen and correct? Probably it's going to STDERR rather than STDOUT -- Who can say where the road goes Where the day flows Only time --Pilgrim (Enya - A Day Without Rain) From rbowen at rcbowen.com Thu Jun 21 17:15:21 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: back tick problem In-Reply-To: <200106212111.f5LLBna03115@rhiannon.rcbowen.com> References: <200106212111.f5LLBna03115@rhiannon.rcbowen.com> Message-ID: <200106212215.f5LMFOO03259@rhiannon.rcbowen.com> On 21 Jun 2001 17:11:44 EDT, Rich Bowen said: > > On Thu, 21 Jun 2001 16:58:56 -0400 (EDT), Ronald Edward Petty said: > > > > > $t = `$argv[0]`; > > $t2 = `$t`; Hmm. I assumed that you were using backticks, since that was your subject line. Where are the backticks? You're just setting $t2 to the value of $t. -- Pilgrim, how you journey on the road you chose To find out where the winds die and where the stories go --Pilgrim (Enya - A Day Without Rain) From repett0 at sweb.uky.edu Thu Jun 21 17:46:01 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: back tick problem In-Reply-To: <200106212215.f5LMFOO03259@rhiannon.rcbowen.com> Message-ID: yeah its backticks.. and why doesn't `$t` execute t if its a command? Ron > > > > > > $t = `$argv[0]`; > > > $t2 = `$t`; > > Hmm. I assumed that you were using backticks, since that was your subject line. > Where are the backticks? You're just setting $t2 to the value of $t. > > -- > Pilgrim, how you journey on the road you chose > To find out where the winds die and where the stories go > --Pilgrim (Enya - A Day Without Rain) > > > From jgibson at lexmark.com Fri Jun 22 07:43:05 2001 From: jgibson at lexmark.com (John Gibson) Date: Thu Aug 5 00:06:07 2004 Subject: LPM: back tick problem In-Reply-To: ; from repett0%sweb.uky.edu@interlock.lexmark.com on Thu, Jun 21, 2001 at 04:58:56PM -0400 References: Message-ID: <200106221243.IAA23520@interlock2.lexmark.com> Try this. $t = `$argv[0] 2>&1`; $t2 = `$t 2>&1`; This should capture the standard error also. On 16:58, 06/21/01, Ronald Edward Petty said: > > $t = `$argv[0]`; > $t2 = `$t`; > > If argv[0] is command that produces another commane > newfs .... will make mkfs ..... > > and the `$t` executes.... why is the output of that $2 null even though it > is scrolling on the screen and correct? > > Ron -- John Gibson jgibson@lexmark.com Pinky, are you pondering what I am pondering? I think so Brain, but how do we get a pair of Abe Vegoda's pants?