• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shell Script on a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Shell Script on a string
      • From: Hudson Barton <email@hidden>
References: 
 >Shell Script on a string (From: Hudson Barton <email@hidden>)

  • Prev by Date: Re: GraphicConverter & saving files in new places
  • Next by Date: Re: Mounting Shares in OS X.2 on MS Server v. Mac Client
  • Previous by thread: Shell Script on a string
  • Next by thread: Re: Shell Script on a string
  • Index(es):
    • Date
    • Thread