From owner-freebsd-current Tue Sep 15 05:28:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA24030 for freebsd-current-outgoing; Tue, 15 Sep 1998 05:28:07 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from gilgamesch.bik-gmbh.de (gilgamesch.bik-gmbh.de [194.233.237.91]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA23983 for ; Tue, 15 Sep 1998 05:28:02 -0700 (PDT) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.8.8/8.7.3) id QAA07514; Tue, 15 Sep 1998 16:27:42 +0200 (MET DST) Message-ID: <19980915162741.A7479@cons.org> Date: Tue, 15 Sep 1998 16:27:41 +0200 From: Martin Cracauer To: "David E. Cross" , freebsd-current@FreeBSD.ORG Subject: Re: 'bug' in /bin/sh's builtin 'echo' References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i In-Reply-To: ; from David E. Cross on Mon, Sep 14, 1998 at 11:06:26PM -0400 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In , David E. Cross wrote: > I have been attempting to do some network installs of SGI IRIX 6.5 > machines off of a -CURRENT machine. IRIX 6.5 makes heavy use of 'echo > foo\c'. By reading the manpage for echo it appears that '\c' is POSIX to > not print a newline (similar to -n). In fact /bin/echo 'does the right > thing' without the '-e' option. The shell builtin in /bin/sh however > requires '-e' to parse \c correctly. For the moment I have inserted the > '#define eflag 1' into the 'echo.c' builtin. Should this change make it > into the tree 'officially'? Personally, I don't like any backslash chars to be active without -e. Imagine you construct a simple shell script in the commandline and pass it to a shell as standard input. I'd really like the construct tool - which is usually echo - can be made *completly* transparent. Otherwise, I'll face quoting hell. echo 'echo -n Date is:" " ; date' | sh Also, what happens if \c isn't at the end of the string? The -n construct seems superiour to me. For the record, bash doesn't support \c without -e, Sun's sh and ksh do. Anyway, please file a PR about this. I'll take care of it when my Posix documents arrive, which should be in time for the 3.0 release. Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer BSD User Group Hamburg, Germany http://www.bsdhh.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message