[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Validating files and directories
From: |
Greg Wooledge |
Subject: |
Re: Validating files and directories |
Date: |
Sat, 13 Nov 2021 08:27:37 -0500 |
On Sat, Nov 13, 2021 at 12:50:25PM +0000, Chris Elvidge wrote:
> On 13/11/2021 06:19 am, Alex fxmbsw7 Ratchev wrote:
> > -a is like && 'and'
> > -e means existing at all
> > if -e is true it may be -d -f or fifo or socket, or such
>
> I suggest you reread 'help test'
He probably won't. And that protonmail user probably won't. So let's
be explicit here:
unicorn:~$ help test | grep -e -a -e -e
-a FILE True if file exists.
-e FILE True if file exists.
[...]
The unary -a and -e operators in test are identical in bash.
If you want more backstory, check the POSIX test(1p) man page:
but there was no easy way to determine that an existing file was a reg‐
ular file. An early proposal used the KornShell -a primary (with the
same meaning), but this was changed to -e because there were concerns
about the high probability of humans confusing the -a primary with the
-a binary operator.
The POSIX test command only supports the unary -e operator, and does not
list a unary -a operator. (And the binary -a is considered obsolescent.)
- Validating files and directories, irenezerafa, 2021/11/12
- Re: Validating files and directories, Alex fxmbsw7 Ratchev, 2021/11/13
- Re: Validating files and directories, Alex fxmbsw7 Ratchev, 2021/11/13
- Re: Validating files and directories, Chris Elvidge, 2021/11/13
- Re: Validating files and directories,
Greg Wooledge <=
- Validating files and directories, irenezerafa, 2021/11/13
- Re: Validating files and directories, Greg Wooledge, 2021/11/13
- Validating files and directories, irenezerafa, 2021/11/13
- Re: Validating files and directories, Chet Ramey, 2021/11/15
- Validating files and directories, irenezerafa, 2021/11/16
- Re: Validating files and directories, Chet Ramey, 2021/11/16
- Validating files and directories, irenezerafa, 2021/11/16
- Netiquette, Tapani Tarvainen, 2021/11/13
- Netiquette, irenezerafa, 2021/11/13
- Netiquette, irenezerafa, 2021/11/13