|
|
uptime...
rob,
I get:
5:34PM up 4:35, 3 users, load averages: 0.00, 0.00, 0.00when I do the "uptime" command, but nothing (just a blank line) when I do the other command. Is there something wrong here? How to fix?? Thanks, John P.S. Why the "3 users" item? It's just me on this machine... Weird.
uptime...
Change the command to "uptime | sed 's/.* //g'"
uptime...
If you know you want the last column of the output, you can use:
uptime | awk '{print $NF}'
As inferred elsewhere in this thread, $1...$12 refer to field 1... field 12. NF is a variable (presumably read-only) that refers to 'number of fields' in this line. $NF dereferences to value of last field. You can also do tricky stuff like $(NF-2)
I don't know do much Applescript, but there is some sort of construct like
set theVar equal to the last word in theOutputwhich would probably do the same thing if you preferred. Hope that helps, RET |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|