Hi All,
I have 3 prepared 3 bash scripts as per requirement , please suggest 3 or many scripts call from one main script .
Example:
As per criteria script build for various purpose .
1. Application backup script
2 . Application deploy script
3 . Application roll back script
As per above criteria i have prepared 3 or N (here N is number from 2 to many) scripts but need combine in one script for layman's understand purpose .
Please guide me for combine scipts in one single script as per require option that script should run .
if possible as mentioned above criteria then please guide me .
I hope explained my problem clearly .
I am waiting for your valuable information .
Regards,
Jeesshnasree
I'm going to have to ask that you restate your query. I've read it a couple of times, but I'm not able to decipher exactly what you're asking.
If you need to execute 3 scripts from one main script, you should create main.sh script which contains:
./script1.sh
./script2.sh
./script3.sh
Then execute it: ./main.sh
Make sure all your scripts have execute permission.
I dont know if this is the correct answer to your question, because your instructions are very confusing
Hi ,
that script means 1 after one execution but my requirement is like menu .
if select option then execute accordingly as per scripts.
please provide if not possible merge then how to execute required options in one program. Please guide me..
Please cancel Accepted solution it's wrongly selected due to stuck system.
@jeesshnasree I have removed the wrongly marked solution.
Please provide me revoke option for Accepted as Solution option.
@jeesshnasree if you know the concept of function, while loop and case statements in bash scripting, you can easily write a main script which can display menu options to user and based on user selection execute the corresponding scripts.
eg. use a function to display the menu to a user in number of options with a title of the options using "echo" :
function script_menu {
echo "1) App Backup (./backup.sh)"
echo "2) App Deploy (./deploy.sh)"
echo "3) App Rollback (./rollback.sh)"
echo "4) Exit"
echo -n "Enter your choice (1-3): "
}
Then use while loop to read the user choice and evaluate the options and run the fucntion. use case statement to run the corresponding script for appropriate user choice.
Hi @Chetan_Tiwary_ ,
Please provide sample of the script above execution , if possible please share .
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.