[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: make [[ compatible with [ 'Option'?

From: Chet Ramey
Subject: Re: RFE: make [[ compatible with [ 'Option'?
Date: Mon, 28 Mar 2011 20:46:42 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

On 3/28/11 1:53 PM, Linda Walsh wrote:
> Is it possible to have an 'Option' to make '[[' compatible
> with '[', w/rt pathname expansion?

Anything's possible.  Likely?  No.

> It seems counter-intuitive to have:
> d="/etc/rc.d/rc5.d"
> if [[ ! -e $d/S??sshd ]]; then echo "sshd not enabled"; fi
> give different output than:
> if [ ! -e $d/S??sshd ]; then echo "sshd not enabled"; fi

I don't consider it counterintuitive.  You have to understand the
differences between [[ and [ and take them into account when you use
it.  One of the basic features of [[, one of the fundamental reasons
it was created, was to not have the words undergo pathname expansion.
I don't think implementing an option to disable that is a good use of

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]