Windows Command-Line Arguments; Secrets or Stitching Them Together

2013-01-11 Thread Brandon McCaig
o such mechanism exists for cmd.exe that I am aware of. %* is substituted for the command line arguments, but they aren't quoted or escaped so they are not preserved. You could hard-code up to 9 arguments with "%1" "%2" ... "%n", but then you'll be passing always

Re: Some explanation please -- iterating thru command line arguments

2010-07-23 Thread newbie01 perl
Hi Brandon, Thanks ... using the cat and pipe looks "cleaner" ... I will try that one ... thanks On Fri, Jul 23, 2010 at 4:53 AM, Brandon McCaig wrote: > On Wed, Jul 21, 2010 at 1:17 PM, newbie01 perl > wrote: > > Does $_ contains the following values on each iteration? > > > > mail_smtp.pl >

Re: Some explanation please -- iterating thru command line arguments

2010-07-22 Thread Brandon McCaig
On Wed, Jul 21, 2010 at 1:17 PM, newbie01 perl wrote: > Does $_ contains the following values on each iteration? > > mail_smtp.pl > -r > ${MAILFROM} > -s > "$subject_line TEST EMAIL" > supportm...@test.com > < > /tmp/test_email.txt Just to clarify the end of the command line: mail_smtp.pl -r ${M

Re: Some explanation please -- iterating thru command line arguments

2010-07-21 Thread John W. Krahn
"$subject_line TEST EMAIL" supportm...@test.com< /tmp/test_email.txt The Perl script is working and SMTP mail is working. Am just trying to understand how the getval sub-routine is parsing the command line arguments. the getval subroutin

Re: Some explanation please -- iterating thru command line arguments

2010-07-21 Thread Jim Gibson
led from a > UNIX Korn script as below: > > mail_smtp.pl -r ${MAILFROM} -s "$subject_line TEST EMAIL" > supportm...@test.com < /tmp/test_email.txt > > The Perl script is working and SMTP mail is working. Am just trying to > understand how the getval sub-routine is par

Some explanation please -- iterating thru command line arguments

2010-07-21 Thread newbie01 perl
EMAIL" supportm...@test.com < /tmp/test_email.txt The Perl script is working and SMTP mail is working. Am just trying to understand how the getval sub-routine is parsing the command line arguments. the getval subroutine is as below.

Re: hwo to configure the Getopt:::STD options for command line arguments.

2006-10-16 Thread W.P.Nijhof
perl pra wrote: hi All, I have to call some perl scripts with command line arguements from another perl script. (some thing like this) perl -s -a $ENV{X} -b $ENV{Y} -c $ENV{Z} ; ( -a , -b, -c are also the arguments to call the script) ( the $ENV{x}=C:\xyz\abc,$ENV{Y}=abc,$ENV{Z}=5).

hwo to configure the Getopt:::STD options for command line arguments.

2006-10-16 Thread perl pra
hi All, I have to call some perl scripts with command line arguements from another perl script. (some thing like this) perl -s -a $ENV{X} -b $ENV{Y} -c $ENV{Z} ; ( -a , -b, -c are also the arguments to call the script) ( the $ENV{x}=C:\xyz\abc,$ENV{Y}=abc,$ENV{Z}=5). I understand we

Re: parsing command line arguments multiple times

2005-04-29 Thread John Doe
Am Freitag, 29. April 2005 11.22 schrieb lohit: > On 4/29/05, John Doe <[EMAIL PROTECTED]> wrote: > > Am Freitag, 29. April 2005 10.19 schrieb lohit: > > > On 4/29/05, John Doe <[EMAIL PROTECTED]> wrote: > > > > Am Freitag, 29. April 2005 09.19 schrieb lohit: > > > > > On 4/29/05, lohit <[EMAIL PRO

Re: parsing command line arguments multiple times

2005-04-29 Thread lohit
On 4/29/05, John Doe <[EMAIL PROTECTED]> wrote: > > Am Freitag, 29. April 2005 10.19 schrieb lohit: > > On 4/29/05, John Doe <[EMAIL PROTECTED]> wrote: > > > Am Freitag, 29. April 2005 09.19 schrieb lohit: > > > > On 4/29/05, lohit <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > Hi > > > > >

Re: parsing command line arguments multiple times

2005-04-29 Thread John Doe
Am Freitag, 29. April 2005 10.19 schrieb lohit: > On 4/29/05, John Doe <[EMAIL PROTECTED]> wrote: > > Am Freitag, 29. April 2005 09.19 schrieb lohit: > > > On 4/29/05, lohit <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Hi > > > > > > i have a requirement, as in based on one command line option, t

Re: parsing command line arguments multiple times

2005-04-29 Thread lohit
On 4/29/05, John Doe <[EMAIL PROTECTED]> wrote: > > Am Freitag, 29. April 2005 09.19 schrieb lohit: > > On 4/29/05, lohit <[EMAIL PROTECTED]> wrote: > > > Hi, > > Hi > > > > i have a requirement, as in based on one command line option, the rest > > > of the arguments change for the same script.

Re: parsing command line arguments multiple times

2005-04-29 Thread John Doe
Am Freitag, 29. April 2005 09.19 schrieb lohit: > On 4/29/05, lohit <[EMAIL PROTECTED]> wrote: > > Hi, Hi > > i have a requirement, as in based on one command line option, the rest > > of the arguments change for the same script. > > eg: script could be called in either of the ways > > script1 -

Re: parsing command line arguments multiple times

2005-04-29 Thread lohit
On 4/29/05, lohit <[EMAIL PROTECTED]> wrote: > > Hi, > i have a requirement, as in based on one command line option, the rest of > the arguments change for the same script. > eg: script could be called in either of the ways > script1 -option1 -option2 adfas -option3 > script -option1 -option4

parsing command line arguments multiple times

2005-04-28 Thread lohit
Hi, i have a requirement, as in based on one command line option, the rest of the arguments change for the same script. eg: script could be called in either of the ways script1 -option1 -option2 adfas -option3 script -option1 -option4 my question is 1. how do we get the option1 alone from GetO

Re: Passing command line arguments

2005-04-14 Thread Jay Savage
On 4/13/05, Bret Goodfellow <[EMAIL PROTECTED]> wrote: > I have a script that is reading input from ARGV. The script is being > passed a file name as follows: > > datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log > > The problem I am running into is that the space is not recognized in the

Re: Passing command line arguments

2005-04-14 Thread Stephen Day
On Friday 15 April 2005 12:18 am, John W. Krahn wrote: > >>datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log > > > > You could paste the two arguments together in perl, add > > a space between them, and use that as the filename. > > What if there are two or more spaces? A TAB character? Th

Re: Passing command line arguments

2005-04-14 Thread John W. Krahn
Stephen Day wrote: On Wednesday 13 April 2005 11:12 pm, Bret Goodfellow wrote: I have a script that is reading input from ARGV. The script is being passed a file name as follows: datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log You could paste the two arguments together in perl, add a space

Re: Passing command line arguments

2005-04-14 Thread Stephen Day
On Wednesday 13 April 2005 11:12 pm, Bret Goodfellow wrote: > I have a script that is reading input from ARGV. The script is being > passed a file name as follows: > > datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log You could paste the two arguments together in perl, add a space between t

RE: Passing command line arguments

2005-04-13 Thread Moon, John
Subject: Passing command line arguments I have a script that is reading input from ARGV. The script is being passed a file name as follows: datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log The problem I am running into is that the space is not recognized in the argument. All that I

Passing command line arguments

2005-04-13 Thread Bret Goodfellow
I have a script that is reading input from ARGV. The script is being passed a file name as follows: datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log The problem I am running into is that the space is not recognized in the argument. All that I get passed to is is c:\program. How do

Re: Confused about supplying command line arguments and using @ARGV

2004-06-04 Thread Jenda Krynicky
From: "Dennis G. Wicks" <[EMAIL PROTECTED]> > I just did extensive testing using ActiveState perl on XP-Pro > and I get the exact same results. > > C:\DATAFI~1>argv.pl testfile > > gives the unitialized variable message but > > C:\DATAFI~1>perl argv.pl testfile > > works as expected. It ain'

Re: Confused about supplying command line arguments and using @ARGV

2004-06-04 Thread David Kirol
08:29:45 -0400 (EDT) > > From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > > Reply-To: [EMAIL PROTECTED] > > To: Larry Wissink <[EMAIL PROTECTED]> > > Cc: [EMAIL PROTECTED] > > Subject: Re: Confused about supplying command line argum

RE: Confused about supplying command line arguments and using @ARGV

2004-06-04 Thread Larry Wissink
#x27;s just confusing that it works that way and not the other... Thanks very much for the suggestion. It was so frustrating since every example/documentation assumes you can simply supply command-line arguments. (And it should be that simple.) -Original Message- From: Jeff 'japh

Re: Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Dennis G. Wicks
400 (EDT) > From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > To: Larry Wissink <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: Confused about supplying command line arguments and using > @ARGV > > On Jun 2, Larry

Re: Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Jeff 'japhy' Pinyan
On Jun 2, Larry Wissink said: >I want to supply the name of a file on the command line when executing a >script. Unfortunately, I'm getting an error that says that @ARGV is >uninitialized. > >How do you initialize @ARGV? How do you specify command line arguments? You do

Confused about supplying command line arguments and using @ARGV

2004-06-03 Thread Larry Wissink
Hi, I thought this would be simple... I want to supply the name of a file on the command line when executing a script. Unfortunately, I'm getting an error that says that @ARGV is uninitialized. How do you initialize @ARGV? How do you specify command line arguments? I'm using

Re: Problem accessing the command line arguments

2002-05-02 Thread John W. Krahn
Chris Ball wrote: > > > "Sailaja" == Sailaja Gudipati <[EMAIL PROTECTED]> writes: > > Sailaja> if($ARGV[0] !~ /-f/) print "Wrong switch"; > > This looks fine, though you need braces around the print statement. > Also note that 'foo-fbar' matches this regexp. I'd use: > > if ($ARGV

Re: Problem accessing the command line arguments

2002-05-02 Thread Chris Ball
e not allowed" } should work just fine. _However_, this is already being picked up by your check on the number of elements in @ARGV, since an empty string won't appear as an array element. Sailaja> But, since @ARGV is empty, I am unable to validate the Sailaja> command line

Problem accessing the command line arguments

2002-05-02 Thread Sailaja Gudipati
me know how to use $USAGE also. The following is the pseudo code I want to use by using @ARGV. if($ARGV[0] !~ /-f/) print "Wrong switch"; if($ARGV[1]) !~ //) print "Empty file name not allowed"; But, since @ARGV is empty, I am unable to validate the command line arguments. P

Re: command line arguments

2002-03-06 Thread Jenda Krynicky
From: Nikola Janceski <[EMAIL PROTECTED]> > Is there a way to get the command line arguments before they are > expanded by the shell? > > script.pl file* names* > > I want to get the file* and not the expanded list of file1 file2 file3 > file4 etc. > > I k

RE: command line arguments

2002-03-06 Thread Hanson, Robert
--Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:08 PM To: Hanson, Robert; Nikola Janceski; Beginners (E-mail) Subject: RE: command line arguments I was hoping for some way to capture it in perl instead with out having to change the co

Re: command line arguments

2002-03-06 Thread Chris Ball
>>>>> "Nikola" == Nikola Janceski <[EMAIL PROTECTED]> writes: Nikola> Is there a way to get the command line arguments before they Nikola> are expanded by the shell? Nope. Perl simply doesn't get to see them. It's part of your interactio

RE: command line arguments

2002-03-06 Thread Nikola Janceski
I was hoping for some way to capture it in perl instead with out having to change the command line arguments. -Original Message- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:05 PM To: 'Nikola Janceski'; Beginners (E-mail) Subject: RE: co

RE: command line arguments

2002-03-06 Thread Hanson, Robert
il) Subject: command line arguments Is there a way to get the command line arguments before they are expanded by the shell? script.pl file* names* I want to get the file* and not the expanded list of file1 file2 file3 file4 etc. I know I can put it in quotes but is there any other way around it?

command line arguments

2002-03-06 Thread Nikola Janceski
Is there a way to get the command line arguments before they are expanded by the shell? script.pl file* names* I want to get the file* and not the expanded list of file1 file2 file3 file4 etc. I know I can put it in quotes but is there any other way around it? Delivery Queue <http://

Re: command line arguments

2002-02-06 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > This script gives me nothing: > > #!/usr/bin/perl -F/\t/ -ap > > print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 1816; ^ > print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 5380;

command line arguments

2002-02-06 Thread ABhagwandin
This script gives me nothing: #!/usr/bin/perl -F/\t/ -ap print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 1816; print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 5380; print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 5370; The file is indeed tab delimited, and the sixth field should have a number in

Re: Command Line arguments.

2001-11-21 Thread Martin Pfeffer
On Tue, 20 Nov 2001 23:50:54 -0500, you wrote: my @args = @ARGV; @ARGV contains the command line parameter. martin >In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Nicolae Popovici) wrote: > >> Hi guys, >> >> Can anyone tell me how can I take the

Re: Command Line arguments.

2001-11-21 Thread Scott R. Godin
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Nicolae Popovici) wrote: > Hi guys, > > Can anyone tell me how can I take the command line arguments in a perl > script . I forgot how to do it . > Thanks for your support . Couple ways. process a loop around @A

RE: Command Line arguments.

2001-11-20 Thread RArul
The command-line arguments are stored in the built-in @ARGV array. Therefore, if you say something like : perl sample.pl argument1 argument2 argument3 then in your program you can access each of the command-line arguments as follows print $ARGV[0]; #prints argument1 print $ARGV[1]; #prints

Command Line arguments.

2001-11-20 Thread Nicolae Popovici
Hi guys, Can anyone tell me how can I take the command line arguments in a perl script . I forgot how to do it . Thanks for your support . Regards, Nick -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Starting a script with command line arguments

2001-07-19 Thread Martin Schneider
1]\n";# 2nd command line argument. print "Count is: $count\n";# Number of arguments. carp "Not enough arguments to get started" unless $count > 0; @ARGV stores command line arguments. For more sophisticated command line support, look at the GetOpt modules. HTH, Martin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Help: Starting a script with command line arguments

2001-07-19 Thread Mooney Christophe-CMOONEY1
Command line arguments are passed to the script in the array '@ARGV', not '@_'. '@_' is used for subroutines. -Original Message- From: Bob Bondi [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 12:51 PM To: [EMAIL PROTECTED] Subject: Help: Start

Help: Starting a script with command line arguments

2001-07-19 Thread Bob Bondi
My question is: how can I pass arguments to a script from the command line? The script at the tail of this message is what I thought would print the 2 arguments I passed into the script, yet the output for this snippet is: Here ya go: Here ya go: Count is: 0 Not enough arguments to get started #\

Re: Command Line Arguments and @_

2001-06-04 Thread Hasanuddin Tamir
On Mon, 4 Jun 2001, Paul <[EMAIL PROTECTED]> wrote, > --- George Petri <[EMAIL PROTECTED]> wrote: > > > "When you launch a script from the command line, for example, @_ > > populates with all of the parameters passed in through the command > > line" > > Typo. @ARGV is correct, as you already

Re: Command Line Arguments and @_

2001-06-04 Thread Paul
--- George Petri <[EMAIL PROTECTED]> wrote: > "When you launch a script from the command line, for example, @_ > populates with all of the parameters passed in through the command > line" Typo. @ARGV is correct, as you already figured out. =o) __

Re: Command Line Arguments and @_

2001-06-04 Thread Jeff Pinyan
On Jun 4, Tony Cook said: >On Mon, 4 Jun 2001, George Petri wrote: > >> >> In a book called "Open Source Linux Web Porgramming" by Jones and Batchelor, >> it says (on Page 61): > >If your book says this, then it's wrong on 2 counts, both of which you >seem to have discovered yourself: Perhaps

Re: Command Line Arguments and @_

2001-06-04 Thread Gary Stainburn
I use "shift @_" (since @_ is > supposedly used by default anyway), I do not get the command line > arguments. > > However, if I use "shift @ARGV", I DO get the command line arguments. > If the shift function really does use @_ as its default argument, > then why

Re: Command Line Arguments and @_

2001-06-04 Thread Michael Fowler
rameters passed in through the command line. The shift > function, among others, will use @_ by default if no other array is provided. This is, as your experimentation has shown, false. Command-line arguments populate @ARGV. The description of shift is correct, but only in certain situatio

Re: Command Line Arguments and @_

2001-06-04 Thread Rolf
George Petri wrote: > However, if I use "shift @ARGV", I DO get the command line arguments. If the > shift function really does use @_ as its default argument, then why did shift > in the example code, use @ARGV as default? Does @_ really get populated > "with all

Re: Command Line Arguments and @_

2001-06-04 Thread Tony Cook
On Mon, 4 Jun 2001, George Petri wrote: > > Hi! > > In a book called "Open Source Linux Web Porgramming" by Jones and Batchelor, > it says (on Page 61): > > "When you launch a script from the command line, for example, @_ populates > with all of the parameters passed in through the command l

Command Line Arguments and @_

2001-06-04 Thread George Petri
will use @_ by default if no other array is provided. #!/usr/bin/perl @firstCommandLineArg=shift; @secondCommandLineArg=shift;" The provided code snipplet works but if I use "shift @_" (since @_ is supposedly used by default anyway), I do not get the command line arguments. Howe