Le 15/05/2017 à 16:30, sisyph...@optusnet.com.au a écrit :
Unfortunately, I don't know how to get that binmode() into the one-liner's angle brackets :-(

$ PERLIO=unix perl -MDigest::SHA1=sha1_hex -le "print sha1_hex <>" secure.txt

Yes, I think that should give the OP the result he was seeking.

Heh ... I didn't realize (until after I had posted) that this was a bash shell solution.
In the cmd shell, of course, the same command simply outputs:

'PERLIO' is not recognized as an internal or external command,
operable program or batch file.

Best approximation I could come up with in the cmd shell was:

set PERLIO=unix && perl -MDigest::SHA1=sha1_hex -le "print sha1_hex <>" secure.txt && set PERLIO=

which is not quite so nice as in bash ;-)

Can my cmd shell implementation be improved upon ?


Reply via email to