• 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: shell script date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell script date


  • Subject: Re: shell script date
  • From: Doug McNutt <email@hidden>
  • Date: Thu, 24 Feb 2005 11:49:04 -0700

At 17:11 +0100 2/24/05, Christian Vinaa wrote:
>however  the month !     &m  gives my   02   but what is the code to ditch any zero in front ?   so I get   2   stead of  02  ?

It does appear to be addressed for the day. I still donno about the month.. Perhaps it should be added to the BUG list.

man date
points to this:

>From:
>man 3 strftime
>     %e	   is replaced by the day of month as a decimal number (1-31); single
>	   digits are preceded by a blank.
>
>	   BUGS
>     There is no conversion specification for the phase of the moon.
>
>     The strftime() function does not correctly handle multibyte characters in
>     the format argument.


date "+%e %d %Y"

24 24 2005
It'll take 5 days to see if it works.

If you want to learn more than you want you can try this:

date "+%m %e %Y" | sed "s/0\([1-9]\)/ \1/"

You'll need a UNIX book covering sed to understand it and it may not be worth your time.


--

--> From the U S of A, the only socialist country that refuses to admit it. <--
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >shell script date (From: Christian Vinaa <email@hidden>)

  • Prev by Date: How do I get a script to ask me the number of times to repeat?
  • Next by Date: A question on System prefs
  • Previous by thread: Re: shell script date
  • Next by thread: shell script date
  • Index(es):
    • Date
    • Thread