MACSCRPT Archives

September 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 17 Sep 2009 16:19:27 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
On Thu, Sep 17, 2009 at 4:13 PM, [log in to unmask] <[log in to unmask]> wrote:
> Just when I thought I'd figured this out..
> The version below returns every line of the file.

Then you must be doing something else wrong.  I pasted your script and
your sample data and it works as expected.

set mLogFile to "/Users/mreed/tv.txt"
set channelID to "(TRAV)"

set thePattern to channelID
set thePattern to "\\|" & channelID & "\\||"
--set myShellScript to "egrep " & thePattern & " " & quoted form of mLogFile
set myShellScript to "egrep " & quoted form of thePattern & " " &
quoted form of mLogFile
set mySchedule to do shell script myShellScript
return mySchedule

returns only the one line:

--11:00 pm|(TRAV)|LOG|Most Haunted USA|<snip>

-- 
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2