• 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
Selecting Last X Lines of Shell Script Result
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Selecting Last X Lines of Shell Script Result


  • Subject: Selecting Last X Lines of Shell Script Result
  • From: Marconi <email@hidden>
  • Date: Mon, 26 May 2008 13:01:12 -0700

I have a number of applescripts that just run a shell script. Typically, I get the result like this:

set my_Message to (do shell script "ls -l /Applications")
display dialog my_Message

(No, this is not an actual use I have for this functionality. The shell scripts are mostly home grown and would not exist on your systems so I used the 'ls' example so you'd see a result on your systems, if you choose to run it.)

The problem is that some of the scripts I run this way return a lot of 'progress' lines as they work and I just want to be able to display the last X lines in the dialog.

When executing a shell script, how do I set the my_Message variable to just the last X lines of the output?



--

"A man who believes in nothing will fall for anything." -- Malcolm X
_______________________________________________
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
  • Follow-Ups:
    • Re: Selecting Last X Lines of Shell Script Result
      • From: Michelle Steiner <email@hidden>
    • Re: Selecting Last X Lines of Shell Script Result
      • From: Craig Williams <email@hidden>
  • Prev by Date: Re: change desktop wallpaper
  • Next by Date: Re: Selecting Last X Lines of Shell Script Result
  • Previous by thread: Re: change desktop wallpaper
  • Next by thread: Re: Selecting Last X Lines of Shell Script Result
  • Index(es):
    • Date
    • Thread