"do shell script" returns different from Terminal. Why?
I'm a novice by all means, so I might be missing the obvious. However, I wanted to have a little AppleScript that returns the SHA1 hash of a string. My results were different from other ways of getting the same hash, so in the end I went and copied into Terminal what AppleScript shows it did. The hashes are different, which I don't understand. I tried to research some character encoding issues, but did not find anything (everything should be Unicode, and that's it).
Could you help me sort out what's going on, and how I could get the hash I want (the same as in Terminal)? Thanks!
Excerpt from AppleScript Editor Result pane after run:
do shell script "echo -n 'RolfAaberge'|openssl sha1"
--> "683acf2937e0a3cd7817a6cd466104b46204c575"
Excerpt from Terminal after run:
echo -n 'RolfAaberge'|openssl sha1
b2f0b01f414f709f311f233633b91bdd5c08ae6a
MacBook (2006 August), Mac OS X (10.6.2)