This is a C shell script that checks the number of arguments and if the file/directory exists. When the arguments are valid, it should go to the last else statement and print "hi", but when I run this script with the correct arguments it doesn't print anything. (but the exit status is 0)
Everything else works fine when I have invalid arguments.
if ($#argv != 2) then echo "Two arguments required" else if (! -f $argv) then echo "File does not exist" exit 1 else if (! -d $argv) then echo "Not a valid directory" exit 2 endif endif else echo "hi" endif
Maybe it's my syntax that is wrong? Any ideas?