It is currently Tue, 17 May 2022 03:13:57 GMT



 
Author Message
 Passing a variable between shell script and perl script
I have a ksh shell script that sets a variable by taking a date input
(format CCYYMMDD) from the console and uses it to do all sorts of
stuff. The last thing the script does is to call a perl script. What I
am trying to do is to pass this date into the perl script but I don't
seem to be having any success and the published wisdom is confusing me
even more. Can someone straighten me out please?

TIA

John



 Sat, 10 Feb 2007 16:47:27 GMT   
 Passing a variable between shell script and perl script
On 24 Aug 2004 01:47:27 -0700, John Drakeson wrote:

Either use $ENV in the perl script or pass the variable as an argument when
calling the perl script.



 Sat, 10 Feb 2007 20:06:47 GMT   
 Passing a variable between shell script and perl script

Here is a one-line perl script, test.pl:

print $ARGV[0], "\n";

Here is how to call it from a shell script:

mydate="20040925 is my date"
/usr/bin/perl test.pl "$mydate"

Here is the output:

20040925 is my date



 Mon, 12 Feb 2007 04:31:52 GMT   
 Passing a variable between shell script and perl script
For an old thicko like me there is often far too much info available.
Thank goodness there are the shining lights out there prepared to help
cut through the chaff. Many thanks guys.

John



 Mon, 12 Feb 2007 16:28:28 GMT   
 
   [ 4 post ] 

Similar Threads

1. Passing a variable from a Perl script to a shell script

2. passing argument between Bourn shell and Perl script

3. Passing variables as arguments to commands in a shell script

4. hlep with passing variables between scripts in Korn Shell

5. environment variables passing to another shell (script)

6. shell-script executes a perl-script???

7. PERL script vs SHELL script

8. Incomplete output from crontab email: running shell scripts from a perl script

9. can you translate shell script into perl script?


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software