bug-bash
[Top][All Lists]
Advanced

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

Re: extension of file-test primitives?


From: Chet Ramey
Subject: Re: extension of file-test primitives?
Date: Wed, 23 Aug 2017 10:27:02 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 8/23/17 10:24 AM, Dethrophes wrote:
> 
> 
>>
>>> Which I always understood as the correct way of doing this in the
>> first place...
>>
>> It's not as good as multiple test commands: test -f file && test -x
>> file.
>> There's no ambiguity and you get short-circuiting.
> 
> Only if you are using the test built-in, otherwise the latter means 2 
> spawns/forks however the shell in question calls the test exec.

Since bash has a test builtin, this isn't exactly on point. But you have
to accept this kind of micro-inefficiency with a shell that sacrifices
speed for size.

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



reply via email to

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