Re: Selecting Last X Lines of Shell Script Result
Re: Selecting Last X Lines of Shell Script Result
- Subject: Re: Selecting Last X Lines of Shell Script Result
- From: Michelle Steiner <email@hidden>
- Date: Mon, 26 May 2008 13:21:12 -0700
On May 26, 2008, at 1:01 PM, Marconi wrote:
When executing a shell script, how do I set the my_Message variable
to just the last X lines of the output?
Assume that you want the last fifteen lines.
set my_Message to (do shell script "ls -l /Applications")
set my_Message to paragraphs -1 through -15 of my_Message
set text item delimiters to return
set my_Message to my_Message as text
display dialog my_Message
--
"Never ask a man what computer he uses. If it's a Mac, he'll tell
you. If it's not, why embarrass him?" --Tom Clancy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden