From owner-freebsd-bugs@FreeBSD.ORG Sun Oct 21 00:50:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 589D9CAC for ; Sun, 21 Oct 2012 00:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 365978FC08 for ; Sun, 21 Oct 2012 00:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9L0o1lI052229 for ; Sun, 21 Oct 2012 00:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9L0o1TJ052228; Sun, 21 Oct 2012 00:50:01 GMT (envelope-from gnats) Date: Sun, 21 Oct 2012 00:50:01 GMT Message-Id: <201210210050.q9L0o1TJ052228@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "John D. Hendrickson and Sara Darnell" Subject: Re: bin/172862: sed improperly deals with escape chars X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "John D. Hendrickson and Sara Darnell" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 00:50:01 -0000 The following reply was made to PR bin/172862; it has been noted by GNATS. From: "John D. Hendrickson and Sara Darnell" To: Garrett Cooper Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/172862: sed improperly deals with escape chars Date: Sat, 20 Oct 2012 20:37:25 -0400 Hi. This should be files as a Question not a Bug. You need to investigate things before claiming "bug". > $ echo "foot " | sed -e 's/[\\t ]*$//' | hexdump -C What I see is your using [] wrong. '\t' doesn't go inside it for many WELL documented reasons. Furthermore sed mathes '\t' without [] so why bother filing a bug against [] ? '\t' has been around more years than your were born and probably sed too... anyhow. "ediquitte" is you ask questions to users and file bugs about only if your very as professor sure and also know how to fix it (pref. wtih code patch filed which absolutely CANNOT cause past software to stop working). p.s. So, when you see a "majorly relied upon" unix tool doing "something stupid" it's very likely you have more learning and asking to do. 1) you don't want people hacking sed to make it work your way it would break past software 2) you don't want BSD-SED to have false bugs filed it will make BSD look worse than it is 3) since early stable versions of free bsd, bsd has accumulated way too many bugs and fixes and hardware compat changes - about a suspicious ammount - and still isn't as stable as it had been ) Garrett Cooper wrote: >> Number: 172862 >> Category: bin >> Synopsis: sed improperly deals with escape chars >> Confidential: no >> Severity: non-critical >> Priority: low >> Responsible: freebsd-bugs >> State: open >> Quarter: >> Keywords: >> Date-Required: >> Class: sw-bug >> Submitter-Id: current-users >> Arrival-Date: Thu Oct 18 21:10:00 UTC 2012 >> Closed-Date: >> Last-Modified: >> Originator: Garrett Cooper >> Release: 9.1-STABLE >> Organization: > EMC Isilon >> Environment: > FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat Sep 22 12:30:11 PDT 2012 gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA amd64 >> Description: > sed doesn't appear to be doing the right thing with escape chars (in this case '\t'); it's not properly reinterpreting '\t' as \011, but is instead interpreting it was 't': > > $ echo "foot " | sed -e 's/[\\t ]*$//' | hexdump -C > 00000000 66 6f 6f 0a |foo.| > 00000004 > $ echo "foot " | sed -E -e 's/[\\t ]*$//' | hexdump -C > 00000000 66 6f 6f 0a |foo.| > 00000004 > > GNU sed does do the right thing with escape chars (verified on Fedora 17): > > # cat /etc/redhat-release > Fedora release 17 (Beefy Miracle) > # echo foot | sed -e 's/[\t ]*$//' | hexdump -C > 00000000 66 6f 6f 74 0a |foot.| > 00000005 > # echo "foot " | sed -e 's/[\t ]*$//' | hexdump -C > 00000000 66 6f 6f 74 0a |foot.| > 00000005 >> How-To-Repeat: > echo foot | sed -e 's/[\t ]*$//' >> Fix: > > >> Release-Note: >> Audit-Trail: >> Unformatted: > _______________________________________________ > freebsd-bugs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-bugs > To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org" >