• 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
SV: Return character after sed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: SV: Return character after sed
      • From: Axel Luttgens <email@hidden>
References: 
 >Return character after sed (From: <email@hidden>)
 >Re: Return character after sed (From: "Mark J. Reed" <email@hidden>)
 >Re: Return character after sed (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Applescript errors
  • Next by Date: Re: Return character after sed
  • Previous by thread: Re: Return character after sed
  • Next by thread: Re: SV: Return character after sed
  • Index(es):
    • Date
    • Thread