On 06/23/2010 09:44 PM, Steven A. DuChene wrote:
> My problem is I want to be able to pick up $2 from the command line invocation
> of my bash script for the desired password and then pass that into the one line
> perl piece. But with all of the single quotes, double quotes, back ticks and
> etc. I am not able to get the password value in the $2 to be correctly passed
> into the perl one line part of the bash script.
>
> The core part of the script I am having a problem with looks like:
>
> #!/bin/bash
>
> OPASS=$2
>
> PASS=`perl -e 'print("userPassword: {CRYPT}".crypt("$OPASS","frat-salt")."\n");'`
I'm sure there is some way to get the results that you want with a one
liner, but there's always the option of writing a separate perl script
that takes OPASS as the argument and outputs the encrypted string, which
you can then include in your bash script with command substitution.
--Jason
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss