Re: Return character after sed
Re: Return character after sed
- Subject: Re: Return character after sed
- From: "Mark J. Reed" <email@hidden>
- Date: Sat, 24 Feb 2007 19:11:35 -0500
Whups, date cares about argument order. The +%H.%M.%S needs to be last.
do shell script "date -r $(sysctl -bn kern.boottime) +%H.%M.%S"
On 2/24/07, Mark J. Reed <email@hidden> wrote:
Seems like going through cut and sed is the wrong solution here... try this:
do shell script "date +%H.%M.%S -r $(sysctl -bn kern.boottime)"
er
as input to the date command, which lets you format it however you
want, in this case as hour.minute.second. Still has the trailing
newline, but you can get rid of it thus:
do shell script "echo -n $(date +%H.%M.%s -r $(sysctl -bn kern.boottime))"
incidentally, the man page for sysctl says that -b yields the raw
value, but it doesn't OMM; -n does. I supplied both options above...
your mileage may vary.
--
Mark J. Reed <email@hidden>
_______________________________________________
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