On  Fri, 2 Feb 2007 22:11:56 +1100,  Tigger <[EMAIL PROTECTED]>  wrote
> 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.
 It is not a problem with  date , it did the same thing both times.  The  echo  
command coalesces consecutive blank space characters down to one blank unless 
they are quoted.  If you change the line
         echo "Finished  : "`date`
to be
          echo "Finished  : `date`"
it will do what you expect.
[snip]
 
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to