From owner-freebsd-current Wed Aug 30 11:06:01 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id LAA18054 for current-outgoing; Wed, 30 Aug 1995 11:06:01 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id LAA18039 for ; Wed, 30 Aug 1995 11:05:53 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA18783; Wed, 30 Aug 1995 11:01:39 -0700 From: Terry Lambert Message-Id: <199508301801.LAA18783@phaeton.artisoft.com> Subject: Re: What do you think of these patches to echo? To: bde@zeta.org.au (Bruce Evans) Date: Wed, 30 Aug 1995 11:01:39 -0700 (MST) Cc: current@freebsd.org, jkh@time.cdrom.com In-Reply-To: <199508301715.DAA15517@godzilla.zeta.org.au> from "Bruce Evans" at Aug 31, 95 03:15:46 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1098 Sender: current-owner@freebsd.org Precedence: bulk > > >Subject: What do you think of these patches to echo? > >... > >Synopsis: > > add \c handling to echo (at the end of an arglist, is > > synonymous with echo -n ...) > > :-(. 8-). I hate shell scripts that use \c or -n coming from the net and having half of them work on one box and half work on another. Since \c is an undefined escape otherwise, I see no problem with allowing it. On the other hand, all of my scripts intended to be portable will still use: # # define "echon" # ECHON=`echo -n` if test "x$ECHO" = "x-n" then ECHON=xechoc else ECHON=xechon fi xechoc() { echo "$*\c" } xechon() { echo -n "$*" } echon() { $ECHON "$*" } ... echon "what do you want? " read x No shell functions allowed? # # define "echon" # ECHON=`echo -n` if test "x$ECHO" = "x-n" then ECHON="echo" ENSUF="\c" else ECHON="echo -n" ENSUF="" fi $ECHON "what do you want? $ENSUF" read x Please, save me from this abomination! Commit the changes! Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.