Hello,
I need to format the current date (as returned by date(1) ) to the
pattern m-d-, where m is the month in one or digits, d is the day
in one or two digits, and is the year in four digits. The problem
for me is the day and the month, for example August should be 8, and
not 08, and
On Sun, 31 Aug 2008 02:52:07 +0300
Ivan \Rambius\ Ivanov [EMAIL PROTECTED] wrote:
I need to format the current date (as returned by date(1) ) to the
pattern m-d-, where m is the month in one or digits, d is the day
in one or two digits, and is the year in four digits. The problem
for
--On August 31, 2008 2:52:07 AM +0300 Ivan \Rambius\ Ivanov
[EMAIL PROTECTED] wrote:
Hello,
I need to format the current date (as returned by date(1) ) to the
pattern m-d-, where m is the month in one or digits, d is the day
in one or two digits, and is the year in four digits. The
I need to format the current date ... to the pattern
m-d- ... date(1) seems to always put leading zeros.
# date +%m-%d-%Y | sed 's/^0//g'
8-30-2008
Not quite. That fixes the month, but not the day:
$ echo 02-04-2008 | sed 's/^0//g'
2-04-2008
(The g does nothing, because the ^ can
Hello,
Thank you for all of your responses.
I received earlier a private answer from another member of list. He
told me to use the '-' sign after '%' in the date pattern of date(1)
command:
$ date +%-m%-d%Y
This one seems to not include leading zeros and I reworked it to
$ date +%-m-%-d-%Y