Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2007 22:11:56 +1100
From:      Tigger <tigger@lvlworld.com>
To:        freebsd-questions@freebsd.org
Subject:   unexpected result from sh script with `date`
Message-ID:  <20070202111156.GA41151@lilypie.com>

Next in thread | Raw E-Mail | Index | Archive | Help
Hello, the following simply sh script is outputting unexpected results.
Any idea why?

--script--

#!/bin/sh

started=`date`

echo "Started at: $started"
echo "Finished  : "`date`
exit

--output--

Started at: Fri Feb  2 22:13:51 EST 2007
Finished  : Fri Feb 2 22:13:51 EST 2007

--problem--

Between 'Feb' and '2', there is two spaces on the 'Started at' line,
however the 'Finished' one only has 1 space.

I know this sounds picky, but I was not expecting this at all.

uname -a
FreeBSD piglet 6.2-STABLE FreeBSD 6.2-STABLE #0: Fri Jan 19 04:13:20 EST
2007     tigger@piglet:/usr/obj/usr/src/sys/PIGLET  i386


-Tig




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20070202111156.GA41151>