bug-bash
[Top][All Lists]
Advanced

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

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


From: Clark J. Wang
Subject: Re: RFE: make [[ compatible with [ 'Option'?
Date: Tue, 29 Mar 2011 14:44:52 +0800

On Tue, Mar 29, 2011 at 3:09 AM, Linda Walsh <bash@tlinx.org> wrote:

>
>
> Greg Wooledge wrote:
>
>> On Mon, Mar 28, 2011 at 10:53:21AM -0700, Linda Walsh wrote:
>>
>>> if [ ! -e $d/S??sshd ]; then echo "sshd not enabled"; fi
>>>
>>
>> That will fail quite colorfully if the glob matches multiple files.
>> (Also, "$d" should be quoted.)
>>
> ---
>
> If, in 30 years of unix experience, I'd ever seen multiple matches for
> the above pattern, I would be concerned...
>

I often use [[ ]] like this:

if [[ $filename = *.log ]]; then echo ...; fi

You'll often see multiple matches for the above pattern. :)


> --
>

Clark J. Wang


reply via email to

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