troubleshooting Question

Creating a Bash Script Menu

Avatar of Simon336697
Simon336697Flag for Australia asked on
LinuxLinux Distributions
7 Comments1 Solution7863 ViewsLast Modified:
Hi guys!
Id love some help in trying to build a bash script menu.
What Im trying to do is the following...

1. Run a bash script eg.menu.sh
2. When run, it presents the following information......

===============================
--------- BASH MENU: Menu.sh ---------
===============================
Execute the following commands by typing the correct number...

[1] Connect to fire's temp folder
[2] Connect to fire's backup folder
[3] Switch to fire's temp folder
[4} Switch to fire's backup folder
[5] Disconnect from fire's backup folder
[6] Disconnect from fire's temp folder

-----------------------------------------------------------------------------------------
3. The user types '1' to connect ot fire's temp folder for example.


4. The commands I have for this are:

----------------------------------------------
[1] Connect to fire's temp folder
mount -t cifs //192.168.2.3/fire_temp /mnt/net_temp_h_fire_fire_temp -v -o user=scripter,pass=password,domain=WORKGROUP,rw'

----------------------------------------------
[2] Connect to fire's backup folder
'mount -t cifs //192.168.2.3/fire_backups /mnt/net_backups_h_fire_fire_backups -v -o user=scripter,pass=password,domain=WORKGROUP,rw'

----------------------------------------------
[3] Switch to fire's temp folder
cd /mnt/net_temp_h_fire_fire_temp; clear; echo "===== h:\fire\fire_temp ====="; pwd; ls -ltra | more'

----------------------------------------------
[4} Switch to fire's backup folder
cd /mnt/net_backups_h_fire_fire_backups; clear; echo "===== h:\fire\fire_backups ====="; pwd; ls -ltra | more'

----------------------------------------------
[5] Disconnect from fire's backup folder
umount /mnt/net_backups_h_fire_fire_backups

----------------------------------------------
[6] Disconnect from fire's temp folder
umount /mnt/net_temp_h_fire_fire_temp

================
I will add more above, but i just want to get the general idea how you would build this menu.sh script, so that a menu is presented, and all you have to do is press a number for the option you want to be executed.
Any ideas greatly appreciated.



Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros