Question
(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
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