exit status is different between bash and csh shell?, In
Exit status: 0 if OK, 1 if minor problems (e.g., cannot access subdirectory), 2 if serious trouble (e.g., cannot access command-line argument).
In order to test
exit status of the command
ls, let's say we have single file called
ss saved in a folder. Let's list this file based on the status of it's characters using the wildcard
In csh Shell:
ls -d ss ss ls -d s? ss ls -d ?s ss ls -d ?z ls: No match. ls -d ?z | echo $? #check exit status 0
ls -d ss ss ls -d s? ss ls -d ?s ss ls -d ?z ls: cannot access ?z: No such file or directory ls -d ?z | echo $? #check exit status 2
It is the same command
ls, but the exit status is different between
csh shell and
- In csh shell the exit status is
- In bash the exit status is
Now, the questions are:
1) Why the same command
ls has difference exit status between bash and csh shell?
2) What is the importance of this difference in the command behaviour under bash and csh shell?