From owner-freebsd-stable Tue Nov 6 8:46:31 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 0DC7337B405 for ; Tue, 6 Nov 2001 08:46:25 -0800 (PST) Received: from svzserv.kemerovo.su (localhost.dialonly.kemerovo.su [127.0.0.1]) by D00015.dialonly.kemerovo.su (8.11.6/8.11.4) with ESMTP id fA6GdtP19427 for ; Tue, 6 Nov 2001 23:39:55 +0700 (KRAT) (envelope-from eugen@svzserv.kemerovo.su) Message-ID: <3BE8125B.E7DA340C@svzserv.kemerovo.su> Date: Tue, 06 Nov 2001 23:39:55 +0700 From: Eugene Grosbein Organization: SVZServ X-Mailer: Mozilla 4.76 [ru] (X11; U; FreeBSD 4.4-STABLE i386) X-Accept-Language: ru, en MIME-Version: 1.0 To: stable@freebsd.org Subject: sh(1) is broken - loss of data! Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit 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 Hi! Try this script: #!/bin/sh string=`printf "\21"` echo $string | hd You see: 00000000 11 0a |..| 00000002 That's right. Replace 21 with 201 and rerun. You see: 00000000 0a |.| 00000001 Very, very bad. The character is just missing. I've found this accidentally and sent bin/31627. Then I used this script and found more codes: #!/bin/sh i=0 jot -c 256 0 | while read s # we try each code in [0..255] do echo -n $i echo "$s" | wc -c # this mush show 2: first is our char and last is \n i=$(($i+1)) done | grep -v '2$' # find which is processed incorrectly These codes (in decimal) that are processed incorrectly: 0, 9, 10, 11, 33, 129 and 136. That does not depend of locale settings. It is very annoying bug, some of my scripts just cannot handle (f.e., remove) files when names contain some of these codes. Eugene Grosbein To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message