Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is Linux BASH script: Task A - Create a new directory Write a shell script like below, that performs the following task: 1. Reads

This is Linux BASH script:

image text in transcribed

Task A - Create a new directory Write a shell script like below, that performs the following task: 1. Reads the name of the directory. 2. Check whether the given input is a directory or regular file. 3. If the input is a directory and it exists, then display the message "Directory exists. Do not create". 4. If the input is a regular file, then display the message "Directory exists. Do not create". 5. If the given input name in step-1 doesn't exist, then create the new directory with the given name in step-1. svatsa@svatsa-VirtualBox:~/script$ ./create_dir.sh Enter the directory home Directory exists! Do not create svatsa@svatsa-VirtualBox:~/script$ ./create_dir.sh Enter the directory /etc/passwd It is a regular file. Do not create. svatsa@svatsa-VirtualBox:~/script$ ./create_dir.sh Enter the directory test_dir Directory doesn't exist, creating test_dir now... svatsa@svatsa-VirtualBox:~/script$ ls -l

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_2

Step: 3

blur-text-image_3

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

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

Cite ways to reduce excess spending.

Answered: 1 week ago