delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/25/12:15:06

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 17:14:49 +0000
Message-Id: <032520051714.23741.4244470900087EF400005CBD22007340760A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

> On Fri, Mar 25, 2005 at 04:37:26PM +0000, Eric Blake wrote:
> I'm not sure I understand the removal of "``" for "portability" in the
> same patch which changes
> 
>   A=foo
>   export A
> 
> to
>   export A=foo

Yes, export A=foo is nonportable (/bin/sh, which is ash, does not like it, even though POSIX requires it), but since that line is inside the case that is doing shell-specific settings of PS1, it is guaranteed to only be executed by bash, which handles it.  By the way, is there a newer version of ash that is more POSIX-compliant?  The current version is more than a year old.

> 
> I've never seen a shell that didn't understand "``" but I have seen shells
> which didn't understand export A=foo.

It is not "``" alone, but "`""`" that has problems.  Some shells require the nested "" to be escaped with \, others don't, since some shells treat "`" as an error, and others can't parse "`\"\"`".  But since case does not do word splitting or filename expansion on its argument, and since `` is a quoting pattern and therefore forms the argument to case, (even if inside the `` contains spaces, or the command output has spaces), case `echo "$0"` is portable while case "`echo "$0"`" and case "`echo \"$0\"`" are not.  See the autoconf manual for more details.

> 
> Personally, I wish we wouldn't play any prompt games in the system profiles.
> I'd rather just either just have the standard prompt that the shell uses
> or my own customized version rather than assuming that we all know what
> the cygwin users want for a prompt.

True enough - how about having /etc/default/etc/profile always set PS1="$ ", then have /etc/profile/etc/skel/.bash_profile (and friends) set the colorized version that cygwin users have always had as their default.




--
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