Linux help! For this milestone, you will be removing the Option 1 “stub” (i.e.,
ID: 3661383 • Letter: L
Question
Linux help!
For this milestone, you will be removing the Option 1 “stub” (i.e., changing the simple text message to a functioning option in the menu). The process of creating a functional menu item includes the following:
1.Modification of the shell script to update the “Option 1 – ?” to the more meaningful “Option 1 – File Directory?”
2.Alteration of the message that displays when Option 1 is chosen. The stub version displaying “You chose Option 1” should be updated to display “File Directory Listing”
3. Attachment of a new command in the MenuProject script, under Option 1, to navigate to and display the file listing of the current directory
I have no idea where to start here and I can't even access the options menu as it bounces back with an error.
Explanation / Answer
#!/bin/bash
# Bash MenuProject Script Example
MainMenu='Please enter your choice: '
choicess=("Option 1- File Directory" "Quit")
select ch in "${choices[@]}"
do
case $ch in
"Option 1")
echo "File Directory Listing"
for File in *
doif [ -r $File -a -w $File -a -x $File ]
then
echo $File
fi
done
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.