Question: I need to create a script file called file_ops.sh and I am using gedit in Linux. There are supposed to be 4 if then statements
I need to create a script file called file_ops.sh and I am using gedit in Linux.
There are supposed to be 4 if then statements they are supposed to look like this:
if [ operator $! ]
then
echo message
fi
One is supposed to show the file exists and is a file, the 2nd is to show the file exists, 3rd the file does not exist and the 4th the file exists and is a directory. The picture shows what the output should look like but I cant get it to work. 
TELC/Passwu EXISLS [labuser SEC-335-VM scripting_lab] $ sh file_ops.sh /etc/passwdd /etc/passwdd does not exist [labuser@SEC-335-VM scripting_lab] $ sh file_ops.sh /etc Vetc exists /etc exists and is a directory (labuser@SEC-335-VM scripting_lab] $ sh file_ops.sh /etcc Vetce does not exist (labuser@SEC-335-VM scripting_lab]$ |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
