Bash handling of ENOENT on missing files and directories
From:
Jonny Grant
Subject:
Bash handling of ENOENT on missing files and directories
Date:
Tue, 29 Aug 2017 15:40:54 +0300
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
Hello
Could bash have some better handling of ENOENT for directories that
don't exist and files that don't exist?
(B) is good, but (A) and (C) are problematic below.
$ bash --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
A)
$ cd missingdir
bash: cd: missingdir: No such file or directory
B)
$ touch direct
$ cd direct
bash: cd: direct: Not a directory
Should not say a file, when "cd" command. Needs special handling
C)
$ ./main
-bash: ./main: No such file or directory
expected:
A)
$ cd missingdir
bash: cd: missingdir: No such directory
C)
$ ./main
-bash: ./main: No such file
Please keep my email address in any replies
Thanks
Jonny