• 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 and grep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell script and grep


  • Subject: Re: Shell script and grep
  • From: David Hood <email@hidden>
  • Date: Sun, 9 Feb 2003 14:18:35 +1300

On Sunday, February 9, 2003, at 12:18 PM, Christopher Stone wrote:

Greetings,

Can a shell scripted grep routine handle an AppleScript variables for input and output?.

Building on the tr discussion to tidy up line endings:

set toBeGrepped to "Little
bo
peep
has
Lost
her
sheep"
set adjustTolf to (quoted form of (ASCII character 10))
set adjustfromcr to (quoted form of (ASCII character 13))
set greppedResult to do shell script ("echo " & (quoted form of toBeGrepped) & " | tr " & adjustfromcr & " " & adjustTolf & " | grep 'L'") -- all one line
return greppedResult
_______________________________________________
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.
References: 
 >Shell script and grep (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Shell script and grep
  • Next by Date: Testing if another app is running
  • Previous by thread: Re: Shell script and grep
  • Next by thread: Re: Record sorting routine
  • Index(es):
    • Date
    • Thread