Answered step by step
Verified Expert Solution
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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started