Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Nov 2001 01:00:20 +0700
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        Thomas Quinot <thomas@cuivre.fr.eu.org>
Cc:        Eugene Grosbein <eugen@svzserv.kemerovo.su>, stable@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject:   Re: bin/31627 sh(1) is broken - loss of data!
Message-ID:  <20011107010020.A19952@grosbein.pp.ru>
In-Reply-To: <20011106181834.A23607@melusine.cuivre.fr.eu.org>; from thomas@cuivre.fr.eu.org on Tue, Nov 06, 2001 at 06:18:34PM %2B0100
References:  <3BE8125B.E7DA340C@svzserv.kemerovo.su> <20011106181834.A23607@melusine.cuivre.fr.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 06, 2001 at 06:18:34PM +0100, Thomas Quinot wrote:

> > #!/bin/sh
> > string=`printf "\21"`
> > echo $string | hd
>  
> > Replace 21 with 201 and rerun. You see:
> > 00000000  0a                                                |.|
> > 00000001
> 
> Can't reproduce here for the value \201, but for the other values
> you mention it looks like perfectly normal and expected behaviour
> from sh(1). It is not surprising at all that some characters "disappear"
> here: since $string appears unquoted, any character which is whitespace
> w.r.t. shell parsing rules won't be passed to echo.
> Try to quote your string:
>   echo "$string" | hd

I still get unexpected results:

#!/bin/sh
string=`printf "\210"`
echo "$string" | hd

gives me:
00000000  0a                                                |.|
00000001

The same with \12 and \201. Other codes are Ok, thank you for explanation.
I see that \12 is removed by backquotes but wonder what with \201 and \210.

Eugene Grosbein

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011107010020.A19952>