Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(BASH Scripting) Hello, I wrote a script in Bash that prompts the user to input a filename for it to be created, and then I

(BASH Scripting)

Hello, I wrote a script in Bash that prompts the user to input a filename for it to be created, and then I printed out to the terminal that the file has been created. However, I need to revise it so that the script will not create a file if no input is received, and I have no idea how I should re-write it. Below is the script:

#! /bin/bash

echo enter a file name:

read FILENAME

touch $FILENAME

echo $FILENAME has been created

Thank you so much for any help/information you can provide! Screenshots of the script and output is greatly appreciated.

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

1. Draw the equilibrium mechanism between caffeine and aqueous acid

Answered: 1 week ago

Question

What is management growth? What are its factors

Answered: 1 week ago

Question

Compare levels of resolution in conflict outcomes?

Answered: 1 week ago

Question

Strategies for Managing Conflict Conflict Outcomes?

Answered: 1 week ago