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

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
  • Follow-Ups:
    • SV: Return character after sed
      • From: <email@hidden>
References: 
 >Return character after sed (From: <email@hidden>)
 >Re: Return character after sed (From: "Mark J. Reed" <email@hidden>)

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