Perl one liner - passwd confirmation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am working from this script  that was posted last week and attempting to
shorten it into a quick one line Perl command; something like this:

# perl -e 'crypt(password,$1$HsKZkjLV$)'

But I am getting an error message:
"Scalar found where operator expected at -e line 1, near "$1$HsKZkjLV"
 (Missing operator before $HsKZkjLV?)"

I've tried a couple permutations with no luck.  Anybody see a good way to
phrase this?

> --------------------------------------------------------------------------
---
> #!/usr/bin/perl
> #
> # Generate a crypt encrypted password from password and salt.
> #
> print STDERR "salt:";
> $salt= <STDIN>;
> print STDERR "\npassword:";
> system ("stty -echo");
> $text= <STDIN>;
> system ("stty echo");
> print STDERR "\n";
> chop ($text);
> $encrypted=crypt($text,$salt);
> print "$encrypted\n";
>


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux