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
Get step-by-step solutions from verified subject matter experts
