[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Validating files and directories
From: |
irenezerafa |
Subject: |
Validating files and directories |
Date: |
Sat, 13 Nov 2021 15:19:14 +0000 |
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, November 13th, 2021 at 3:09 PM, Chris F.A. Johnson
<chris@cfajohnson.com> wrote:
> On Sat, 13 Nov 2021, irenezerafa wrote:
>
> ...
>
> > > 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.)
> >
> > Gnu Bash could moves on and stop supporting and maintaining -a.
> >
> > Here is what bash reference manual says -
> >
> > 6.4 Bash Conditional Expressions
> >
> > -a file
> >
> > True if file exists.
> >
> > -e file
> >
> > True if file exists.
> >
> > How is anybody able to figure out anything from that !
>
> It doesn't take a genius to figure out that if they are both
> documented as doing the same thing that they DO actually do
> the same thing.
>
> Chris F.A. Johnson
Hi Chris, one could reduce unnecessary redundancy by deprecating it
and making it obsolete as mentioned by Greg.
- Re: Netiquette, (continued)
- Re: Netiquette, Chet Ramey, 2021/11/17
- Netiquette, irenezerafa, 2021/11/17
- Re: Re: Netiquette, Thomas Paulsen, 2021/11/18
- Re: Re: Netiquette, Greg Wooledge, 2021/11/18
- Re: Re: Re: Netiquette, Thomas Paulsen, 2021/11/18
- Netiquette, irenezerafa, 2021/11/20
- Re: Netiquette, Chet Ramey, 2021/11/18
- Re: Netiquette, Lawrence Velázquez, 2021/11/13
- Netiquette, irenezerafa, 2021/11/13
- Re: Validating files and directories, Chris F.A. Johnson, 2021/11/13
- Validating files and directories,
irenezerafa <=
Re: Validating files and directories, Andreas Kusalananda Kähäri, 2021/11/13