Review assignment for bash exam
Description
The script will do some random things and should be run from ssh.cs.utahtech.edu
. Present a menu to the user and the option they select will determine the outcome. The script should be in a loop and will exit when they select the appropriate option. The functionality for each option MUST be placed into a function.
Here are the items to present to the user:
- Item 1 -> if selected, will translate some text into a
different
language. The text you can translate is found here. Usewget
in your script to download the file if it doesn’t already exist. The user will be prompted for the language that they would like to use. Here are the allowable language optionspirate
,chef
,eleet
,fudd
. It doesn’t really matter what these do… just note that they are all commands that are found on thescratch
server. You cantranslate
text by doing something likeeleet alice_sample.txt
. (You can see what each of these languages does by runningman filters
on scratch, but you don’t really need to). Your script should prompt the user for one of the above languages, translate the file, and output it to a file named$language.txt
in your home directory on ssh. (i.e. fudd.txt, chef.txt, etc…)(You can see thatchef
is found in/usr/games/chef
on scratch.) So, to clarify, your script will be executed from the ssh server, but will ssh to scratch to do this step. - Item 2 -> if selected, will list all words in /usr/share/dict/words that have the same third to last letter as their last letter, the second to last letter has to be a vowel
aeiou
. The following words are examples that match:wow
,xenon
,yeses
. I found a total of 1401 words that matched. This option should print just the first 10 words that match. - Item 3 -> if selected, will list all words in /usr/share/dict/words that start with an
a
orb
orc
and end with ad
ore
orf
. I found a total of 2841 words. Your script should just print out the last 10 words that match this pattern - Item 4 -> quit or exit the loop
I may show you a solution for this towards the end of class.
Last Updated 02/07/2025