[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extension of file-test primitives?
From: |
Greg Wooledge |
Subject: |
Re: extension of file-test primitives? |
Date: |
Mon, 21 Aug 2017 09:27:13 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Sat, Aug 19, 2017 at 05:30:34PM -0700, L A Walsh wrote:
> Curious, but how difficult or problematic would it be
> to allow using brace-expansion (ex. {f,x} ) as a short-hand
> to test/combine file-op tests like:
>
> Allowing:
>
> test -{f,x} /bin/ls && ...
> or
> if [[ -{f,x} $file ]]; then ... ; fi
>
> instead of:
>
> test -f /bin/ls && test -x /bin/ls && ...
You could write your own helper functions for this:
-fx() { test -f "$1" && test -x "$1"; }
if -fx /bin/ls; then ...; fi
Re: extension of file-test primitives?,
Greg Wooledge <=
- 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