Passing a variable from a Perl script to a shell script

Passing a variable from a Perl script to a shell script

Post by As » Fri, 27 Aug 2004 23:19:01



Hi,

I want to submit a form which has only one password field (Perl) and
the password should be submitted to a shell script.  In the shell
script, I want to process the pssword and use some crypting commands
to Encrypt it.

I do not know how I can process the password from Perl to shell and
how to obget it in Shell

Any help is appreciated. Thanks!

 
 
 

Passing a variable from a Perl script to a shell script

Post by swim learni » Sun, 29 Aug 2004 03:15:18



> Hi,

> I want to submit a form which has only one password field (Perl) and
> the password should be submitted to a shell script.  In the shell
> script, I want to process the pssword and use some crypting commands
> to Encrypt it.

> I do not know how I can process the password from Perl to shell and
> how to obget it in Shell

> Any help is appreciated. Thanks!

To call a shell script from perl, use the "system" statement in Perl.
Example follows.

Here is a perl script, tmp.pl
$password="test123";
system("tmp.sh $password");

Here is the called one-line shell script, tmp.sh:
echo "$1"

Here is how to run the perl script:
$ /usr/bin/perl tmp.pl

tmp.pl calls tmp.sh which outputs:
test123

 
 
 

1. 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

2. Installing Blackdown's jdk 117_v1a on RH 6.0. Please help.

3. How to pass a variable from a shell script to another shell script...

4. adduser

5. Execute a sh script under perl and sh: sh script; perl script?

6. Communicator 4 b6 shell problem

7. How do you pass a value from a shell script into a sqlplus script?

8. telnet problem

9. passing argument between Bourn shell and Perl script

10. environment variables passing to another shell (script)

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

12. hlep with passing variables between scripts in Korn Shell

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