• 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
using grep in a do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using grep in a do shell script


  • Subject: using grep in a do shell script
  • From: Graham Anderson <email@hidden>
  • Date: Mon, 24 Jan 2005 15:07:37 -0800

if I have an xml tag
<ram>512</ram> in an xml file...

how can I get the '512' out of it

this is what I have so far...currently it returns the whole xml file :(

set my_path to (path to preferences) & "Fonovisa.xml" as string
set myfile to POSIX path of my_path
set theScript to "grep ram " & myfile
--return theScript
display dialog (do shell script theScript)

i am using curl to get a word in a remote text file with:
set the_command to "curl -s '" & myURL & "'  | grep currentversion"
set the_level to (word 6 of (do shell script the_command))

just not sure how to do the same with a local file

3rd day in applescript learning curve...

many thanks

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: using grep in a do shell script
      • From: "Adam K. Wuellner" <email@hidden>
    • Re: using grep in a do shell script
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: How to update an applescript app from a remote server?
  • Next by Date: Re: Can?t move mail message
  • Previous by thread: [ANN] ConvexPoly.osax 1.2 available.
  • Next by thread: Re: using grep in a do shell script
  • Index(es):
    • Date
    • Thread