2. Write a bash script that (1) prompts the user to enter a Linux command and re
ID: 3756549 • Letter: 2
Question
2. Write a bash script that (1) prompts the user to enter a Linux command and reads in the user's input, (2) prints out a meaningful message with the user's entered command to be executed, and finally (3) executes the user's entered command. The Linux command is to be read in, not passed as a command-line argument. This bash script should be called rec04B.sh. SAMPLE OUTPUT (input in bold green): ./ Enter Linux command to perform: ls Command to be executed: 1s a.out Lab01A. Lab02B.sh minorl.c minor2.c rec04B. shExplanation / Answer
Answer :
Bash Script:
echo "Enter the linux command to perform:"
read varname
echo Command to be executed: $varname
echo Output:
$varname
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.