delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/25/14:26:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: ericblake AT comcast DOT net (Eric Blake)
To: cygwin AT cygwin DOT com
Subject: Re: base-files patch
Date: Fri, 25 Mar 2005 19:26:14 +0000
Message-Id: <032520051926.2104.424465D60002AFD30000083822058861720A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

> On Fri, 25 Mar 2005, Eric Blake wrote:
> > No, "`echo $0|tr ...`" does the wrong thing if $0 is "two spaces/sh" (it
> > passes just one space to tr, instead of two), while `echo "$0"|tr ...`
> > works correctly.
> 
> In *this particular* case, the value will be compared with a constant set
> of space-free values, so the number of spaces doesn't matter -- it still
> won't match any values from that set...  :-)
> In general you're correct -- quoting is a way of preserving spaces, among
> other things.

True enough.  And that points out another bug - echo "$0" may fail if $0 starts with -, it should be echo -- "$0".  Isn't portable shell programming fun?




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019