From owner-freebsd-hackers Sun Nov 9 23:22:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA09554 for hackers-outgoing; Sun, 9 Nov 1997 23:22:02 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.5.85]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA09547 for ; Sun, 9 Nov 1997 23:21:58 -0800 (PST) (envelope-from tlambert@usr06.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.7/8.8.7) id AAA18516; Mon, 10 Nov 1997 00:21:58 -0700 (MST) Received: from usr06.primenet.com(206.165.6.206) via SMTP by smtp04.primenet.com, id smtpd018508; Mon Nov 10 00:21:57 1997 Received: (from tlambert@localhost) by usr06.primenet.com (8.8.5/8.8.5) id AAA09666; Mon, 10 Nov 1997 00:21:56 -0700 (MST) From: Terry Lambert Message-Id: <199711100721.AAA09666@usr06.primenet.com> Subject: Re: Why doesn't /bin/echo use getopt? To: joerg_wunsch@uriah.heep.sax.de Date: Mon, 10 Nov 1997 07:21:56 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <19971109194318.GE14919@uriah.heep.sax.de> from "J Wunsch" at Nov 9, 97 07:43:18 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > It's ugly, but it works, and this is a rare situation anyway. > > Well, rare situation or not, the question is if you wanna truly echo > something the user has entered into a shell script variable, it seems > your only option is to always do it this way. Nobody does, of course, > which means all these scripts are probably vulnerable against input > starting with -n. SysV is worse, since they were `smart' with their > backslashomania (as opposed to BSD inventing printf(1) for this > purpose). It seems to be nearly impossible to echo a string verbatim > in SysV if you don't know what the string is. So don't use "echo"... cat <