[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/
- Re: extension of file-test primitives?, (continued)
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/21
- Re: extension of file-test primitives?, L A Walsh, 2017/08/23
- Re: extension of file-test primitives?, Greg Wooledge, 2017/08/23
- Re: extension of file-test primitives?, L A Walsh, 2017/08/23
- Re: extension of file-test primitives?, Pierre Gaston, 2017/08/23
- Re: extension of file-test primitives?, Greg Wooledge, 2017/08/23
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/23
- Re: extension of file-test primitives?, Dethrophes, 2017/08/23
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/23
- Re: extension of file-test primitives?, Dethrophes, 2017/08/23
- Re: extension of file-test primitives?,
Chet Ramey <=
- Re: extension of file-test primitives?, dethrophes, 2017/08/23
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/23
- Re: extension of file-test primitives?, dethrophes, 2017/08/23
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/23
- Re: extension of file-test primitives?, dethrophes, 2017/08/23
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/23
- Re: extension of file-test primitives?, Eric Blake, 2017/08/23
- Re: extension of file-test primitives?, DJ Mills, 2017/08/23
- Re: extension of file-test primitives?, Chet Ramey, 2017/08/24
- Re: extension of file-test primitives?, Greg Wooledge, 2017/08/23