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. I need to create a script file called file_ops.sh and I am

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!