• 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: Hudson Barton <email@hidden>
  • Date: Sat, 16 Nov 2002 23:49:34 -0500

At 6:35 PM +0100 11/16/02, Axel Luttgens wrote:
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")


OK. That's excellent. Now I want to do one that requires entering a password (an encryption routine), but I can't get the syntax right. Here's what I have:

set x to (do shell script ("echo '" & myText & "' | openssl bf -salt -pass pass:" & Password1 & ""))


Thanks for your help.

H.
_______________________________________________
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: Axel Luttgens <email@hidden>
References: 
 >Shell Script on a string (From: Hudson Barton <email@hidden>)
 >Re: Shell Script on a string (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: XL - Certain text to bold?
  • Next by Date: Re: Trailing LFs in shell scripts
  • Previous by thread: Re: Shell Script on a string
  • Next by thread: Re: Shell Script on a string
  • Index(es):
    • Date
    • Thread