bug-bash
[Top][All Lists]
Advanced

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

Re: problem with echoing script variable to gpg


From: Eric Blake
Subject: Re: problem with echoing script variable to gpg
Date: Thu, 18 Dec 2008 12:57:54 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18) Gecko/20081105 Thunderbird/2.0.0.18 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to pwaugh on 12/18/2008 1:49 AM:
> digest = $( echo -n ${1} | gpg --print-md sha1 )
> echo digest
> 
> I do not get the same value!!!!  I have no clue why.  Help.

Too much whitespace, and a misunderstanding about how shell variables
work.  You want:

digest=$( echo -n "$1" | gpg --print-md sha1 )
echo "$digest"

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklKq0EACgkQ84KuGfSFAYCFRgCgpsZf3FyDYGAn4nMaPmqIoxAq
No4Anjl+kNnWGowPn+d8U6vpKSY2OV1Y
=Capc
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]