SV: Return character after sed
SV: Return character after sed
- Subject: SV: Return character after sed
- From: <email@hidden>
- Date: Sun, 25 Feb 2007 14:28:07 +0100
- Thread-topic: Return character after sed
Mark,
"Your milage may vary", Thats one thing for sure. I learn that every time I post a question here. In the end what I am looking for is an Applescript date and I modified your line like this:
set myCheckInDate to date (do shell script "date -r $(sysctl -n kern.boottime) +%Y/%m/%d/%H.%M.%S")
but I am sure there is more clean way to turn the boottime into an AS date.
Is it the $ character that feed the boottime to the date-command?
Thanks for your help
Gunno Ivansson
-----Ursprungligt meddelande-----
Från: email@hidden genom Mark J. Reed
Skickat: sö 2007-02-25 01:11
Till: Ivansson, Gunno
Kopia: email@hidden
Ämne: Re: Return character after sed
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