S
Samantha
Hi,
I would like to know how I can pass double quotes to a perl script. ie
I have a test script which has:
#!/usr/local/bin/perl5
print "arg0\n";
print @ARGV[0];
print "\narg1\n";
print @ARGV[1];
print "\narg2\n";
print @ARGV[2];
print "\n";
and I say:
../test hello "1 2"
arg0
hello
arg1
1 2
arg2
I would like arg1 to be "1 2" and not just 1 2
It looks like the " are being stripped out of the argument by the
parser. Similarly, I would like:
../test hello '1 2'
arg0
hello
arg1
1 2
arg2
to print '1 2' for arg1.
the reson I need this is because I am passing "1 2" to another script
which requires these arguments to have "" around them. If the " is
missing, it only reads 1 instead of 1 2
Thanks in advance for any help,
Sam
I would like to know how I can pass double quotes to a perl script. ie
I have a test script which has:
#!/usr/local/bin/perl5
print "arg0\n";
print @ARGV[0];
print "\narg1\n";
print @ARGV[1];
print "\narg2\n";
print @ARGV[2];
print "\n";
and I say:
../test hello "1 2"
arg0
hello
arg1
1 2
arg2
I would like arg1 to be "1 2" and not just 1 2
It looks like the " are being stripped out of the argument by the
parser. Similarly, I would like:
../test hello '1 2'
arg0
hello
arg1
1 2
arg2
to print '1 2' for arg1.
the reson I need this is because I am passing "1 2" to another script
which requires these arguments to have "" around them. If the " is
missing, it only reads 1 instead of 1 2
Thanks in advance for any help,
Sam