How to call different scripts?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to call different scripts?
# 1  
Old 02-27-2013
How to call different scripts?

I have 3 different scripts with 3 different functions, I would like to merge these 3 and make a master script.
The following are my ideas:
- ask user to pick which script he needs
- after choosing, point it to the right script

or...
depending on the inputs provided by the user, all three scripts should be run.

They are graph output, so all 3 graphs must be displayed.

I think the first scenario is more easier.

Is there a way to do so? Please help?
# 2  
Old 02-27-2013
Code:
while :
do
echo "Please input the type of script you want"
read "X";

case $X in

script1)
          echo "You selected $X";
          source /path/to/script1;
          ;;

script2)
          echo "You selected $X";
          source /path/to/script2;
          ;;
script3)
          echo "You selected $X";
          source /path/to/script3;
*)
         echo "Valid Choices are"
         echo "script1, script2 or script3"
         exit;
         ;;
esac
done

---------- Post updated at 04:39 PM ---------- Previous update was at 04:39 PM ----------

adjust the names and paths as per your actual requirement.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call functions from other scripts

i have a file that contains functions and i want the functions to be available in another script. of course, the ideal situation here would be to put the functions in the same script, but i dont own these scripts. so I have to call the functions file from a different script. how do i... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

3. Shell Programming and Scripting

Check existence of a number of files and call other scripts

Hi, I am new to unix scripting and am jus getting to learn about it.. I need to know on how to check for the existence of a number of files in a path..i.e the files are ftp'ed from several other servers, should check if all the files have arrived, if not wait till they arrive..can i use a flag... (5 Replies)
Discussion started by: yohasini
5 Replies

4. UNIX for Advanced & Expert Users

Call parallel sql scripts from shell and return status when both sql are done

Hi Experts: I have a shell script that's kicked off by cron. Inside this shell script, I need to kick off two or more oracle sql scripts to process different groups of tables. And when both sql scripts are done, I will continue in the shell script to do other things like checking processing... (3 Replies)
Discussion started by: huasheng8
3 Replies

5. Shell Programming and Scripting

Call Multiple Scripts With Similar Name

I have a lot of scripts in one directory I was just wondering if there was a single command that could call each script. Example: There are scripts, "stopThisService.sh", "stopThatService.sh", "stopAnotherService.sh", and "stopYetAnotherService.sh". I'd like to be able to call them all by... (1 Reply)
Discussion started by: mrwatkin
1 Replies

6. Shell Programming and Scripting

To call many scripts from mother one simultaneously

Hi, I need to rin few other scripts from one main (mather) script. Working in ksh on LINUX. The only one condition - it should be run in parallel. I mean I have to be able to call 20 scripts from this mother script in parallel (start them in the same time). Does somebody know how to do it? ... (2 Replies)
Discussion started by: juliyp
2 Replies

7. Linux

Call scripts in Rpm's: %pre %post sectino

Hi, In the rpm SPEC file there is %pre section for preinstall scripts. We can write any think in the "sh" format here. I want to call a script here. How can i do this? Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

8. Shell Programming and Scripting

How to call C functions in shell scripts?

How can i call dynamic C functions in shell scripts? (5 Replies)
Discussion started by: agarwal
5 Replies

9. Shell Programming and Scripting

Making a SOAP call from within unix shell scripts

Hi guys, Is it possible to make SOAP calls from within Unix shell scripts? I need to access a web service from within UNIX in order to lookup something while I am doing some parsing on a file. Regards, Laud (2 Replies)
Discussion started by: Laud12345
2 Replies
Login or Register to Ask a Question