Adam Miller wrote:

>    According to the man page, /bin/date +%x should report the
> date in the following format: mm/dd/yy

No it doesn't, it says it reports the date in the format appropriate to
the current locale:

       %x     locale's date representation (e.g., 12/31/99)

Note that "e.g." means it's an example of one possible format.

>    However, when run in bash the command above reports the date in the
> following format: mm/dd/yyyy

Compare the output of:

LANG=C /bin/date +%x

to

LANG=en_US /bin/date +%x

>    I have been calling a bash script in through cron, which reports the
> date as it should.  So why would running the command in bash be different?

You most likely have something in your rc/profile scripts which only
runs for interactive login shells that sets the locale (LC_* and/or LANG
environment variables.)  When run from the cron job they are not set and
the default "C" locale is used.

Brian


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to