Re: Shell Script on a string
Re: Shell Script on a string
- Subject: Re: Shell Script on a string
- From: Axel Luttgens <email@hidden>
- Date: Sat, 16 Nov 2002 18:35:10 +0100
Hudson Barton wrote:
> I have a shell script as follows:
>
> "set this_result to do shell script ("/usr/bin/openssl sha1 " &
> this_File) as string"
>
> I need to know how to run the same routine on a text segment rather
> than on a file. Obviously, I'm inexperienced in working with
> Terminal-like commands.
"openssl sha1" expects some text on its standard output or, if specified
as an argument, in a file.
So, you could use "echo" and pipe its output to openssl's input:
set myText to "aaa" -- the string to digest
do shell script ("echo '" & myText & "' | openssl sha1")
HTH,
Axel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.