Link to home
Create AccountLog in
Avatar of MatthewF
MatthewFFlag for Afghanistan

asked on

How do I pass stdout from perl to shell script.

I have a shell script that calls a perl script to decrypt and pulls back a password.  The perl script prints to stdout the decrypted password. (btw when both the scripts are in perl it works, however I have to have a method to do it from shell to perl as well).   The shell script pring this error


/opt/DIFF/fwd_encrypt.sh[177]: =1qaz2wsx:  not found

fyi fwd_encrypt.sh is the shell script name and 1qaz2wsx: is the decrypted password.

from shell script
$password=`/opt/DIFF/decrypt.pl $PAR`
read password


from perl script
print STDOUT $pass;

Again, if I do this perl to perl it works.  If I call /opt/DIFF/decrypt.pl with an ARV, ie

/opt/DIFF/decrypt.pl testfile  --->  it prints out the decrypted password to stdout.  








ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account