Executing a script from within a script
How would I execute a shell script from within another. For instance I have one script that acts as a main menu, the user picks a choice from menu and if 'x' is picked then current menu is exited and 'x' script is run. THX
|
I suppose you mean something like this:
------------------- #!/bin/bash echo 1. hello echo 2. bye read a if [ $a == "1" ] ; then hello.sh ; fi if [ $a == "2" ] ; then bye.sh ; fi |
Unless the scripts are in your PATH, the above will not work and you will need to provide the path to the script.
You may also wish to have a look at the 'select' command. |
All times are GMT -5. The time now is 11:50 AM. |