Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions