I created a file named q2.c in /home/tuan/Desktop/Shell_programming. I coded a script named "test" to check whether the file existed or not. My code :
#!/bin/sh
submitDir=/home/tuan/Desktop/Shell_programming/submit
if [ -e $submitDir/q2.c ]
then
echo "There is no q2.c"
else
echo "There is q2.c"
fi
After that i executed the code and I got the message from the termial
tuan@tuan:~/Desktop/Shell_programming$ ./test
There is no q2.c
tuan@tuan:~/Desktop/Shell_programming$
I did not get it .
Can anyone explain to me and what should i make a change for my script
Thanks