how to reference bash variables inside perl script inside bash script?

Steven A. DuChene linux-clusters at mindspring.com
Thu Jun 24 09:43:16 MST 2010


I think that did the trick Eric.
Thanks!


-----Original Message-----
>From: Eric Shubert <ejs at shubes.net>
>Sent: Jun 24, 2010 11:02 AM
>To: plug-discuss at lists.plug.phoenix.az.us
>Subject: Re: how to reference bash variables inside perl script inside bash	script?
>

>
>Stuff inside of single quotes won't have variables expanded:
>shubes at edwin:~$ OPASS=test
>shubes at edwin:~$ echo "$OPASS"
>test
>shubes at edwin:~$ echo '$OPASS'
>$OPASS
>shubes at edwin:~$
>
>So you need to have the -e argument surrounded by double-quotes. I don't 
>know if the perl code will allow you to use single quotes in place of 
>double quotes or not. If it does, then maybe use single quotes there for 
>readability. Otherwise, and in the case of the $OPASS parameter, you'll 
>need to escape the double quotes individually, as in:
>PASS=`perl -e "print(\"userPassword: 
>{CRYPT}\".crypt(\"$OPASS\",\"frat-salt\").\"\n\");'`
>
>A bit messy, but I think it would work. ;)
>
>-- 
>-Eric 'shubes'
>
>---------------------------------------------------
>PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
>To subscribe, unsubscribe, or to change your mail settings:
>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss





More information about the PLUG-discuss mailing list