Re: Find text with shell script
Re: Find text with shell script
- Subject: Re: Find text with shell script
- From: dev_sleidy <email@hidden>
- Date: Sun, 6 Aug 2006 07:52:26 -0400
Could anyone tell me the shell script that would find a line of text
in a file containing a certain word? For example, if a file
contained the text "MyFileName" followed by the word I wished to
find, what shell command would reveal that word?
Thanks,
Garry Simon
UNIX 'grep' command.
Example 01:
do shell script "grep 'mail.gna.org/public/' /Users/s/Desktop/_123.txt"
Replace "mail.gna.org/public/" with your search string.
Replace '/Users/s/Desktop/_123.txt' with your file's full path.
Example 02:
set tString to "'mail.gna.org/public/'" -- Replace "mail ....
public/" with your string.
set flle_path to "/Users/s/Desktop/_123.txt" -- Replace
'/Users/s/Desktop/_123.txt' with your file's full path.
do shell script ("grep " & tString & " " & flle_path)
_______________________________________________
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