From owner-freebsd-stable Tue Nov 6 10: 8:42 2001 Delivered-To: freebsd-stable@freebsd.org Received: from D00015.dialonly.kemerovo.su (www2.svzserv.kemerovo.su [213.184.65.86]) by hub.freebsd.org (Postfix) with ESMTP id 8699237B416; Tue, 6 Nov 2001 10:08:35 -0800 (PST) Received: (from eugen@localhost) by D00015.dialonly.kemerovo.su (8.11.6/8.11.4) id fA6I0KH20346; Wed, 7 Nov 2001 01:00:20 +0700 (KRAT) (envelope-from eugen) Date: Wed, 7 Nov 2001 01:00:20 +0700 From: Eugene Grosbein To: Thomas Quinot Cc: Eugene Grosbein , 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> References: <3BE8125B.E7DA340C@svzserv.kemerovo.su> <20011106181834.A23607@melusine.cuivre.fr.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 +0100 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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