From: Arjan de Vet (devet@adv.win.tue.nl)
Date: 04/09/93


From: devet@adv.win.tue.nl (Arjan de Vet)
Subject: [A] /bin/echo which does not strip leading/trailing spaces
Date: 9 Apr 1993 15:37:37 +0200


I noticed recently that Pnews displayed the questions without an additional
space character at the end on Linux:

        Are you absolutely sure [yn]y

On other systems where I use Pnews it looks like:

        Are you absolutely sure [yn] y

The problem was rather easy to find. My /bin/echo was the following script
(from SLS I think):

        #!/bin/sh
        echo $*

I changed it to

        #!/bin/sh
        echo ${1+"$@"}

which does not strip leading and/or trailing spaces. Try this with both
versions and you see the difference:

/bin/echo -n " Hello "; echo "TEST"

Arjan

PS: I use bash as /bin/sh. Don't know what other shells do with their
built-in echo.