[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Validating files and directories
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: Validating files and directories |
Date: |
Sat, 13 Nov 2021 07:19:31 +0100 |
-a is like && 'and'
-e means existing at all
if -e is true it may be -d -f or fifo or socket, or such
On Sat, Nov 13, 2021, 01:22 irenezerafa via <help-bash@gnu.org> wrote:
> I am using the following commands to validate a file or directory.
>
> if [[ ! -f "$fl" && ! -d "$fl" ]]; then
> printf '%s\n' "$fl: File or Directory does not exist"
> fi
>
> But have noticed that I can use -e to see if there's something by that
> name, instead of separately testing -f and -d.
> Yet I am getting confused between using -a and -e.
- Validating files and directories, irenezerafa, 2021/11/12
- Re: Validating files and directories,
Alex fxmbsw7 Ratchev <=
- 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, 2021/11/13
- 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