![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to call C functions in shell scripts? | agarwal | Shell Programming and Scripting | 5 | 04-08-2008 09:03 PM |
| Issue calling scripts through CRON. | vskr72 | Shell Programming and Scripting | 5 | 01-07-2008 04:12 PM |
| any possible solution on sql calling scripts | manas_ranjan | Shell Programming and Scripting | 4 | 11-22-2007 02:02 AM |
| script calling other scripts hangs | rein | Shell Programming and Scripting | 1 | 09-07-2007 02:26 AM |
| Calling SQL scripts through Shell Script | madhunk | Shell Programming and Scripting | 18 | 06-14-2006 09:35 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Calling functions in scripts directly
Hi,
I have a menu driven script that does various tasks, I want to be able to call functions directly from within other unix scripts from my menu script. Is this possible? |
| Forum Sponsor | ||
|
|
|
|||
|
Bascially i have a menu:
doSQLSubMenu() { while true do showSQLSubMenu read answer MSG= case $answer in 1) ;; 2) ;; 3) ;; r|R) break;; *) badChoice;; esac done } I want to make calls functions within different .sh scripts for option 1,2 and 3. So say i had a function view() in a.sh I would ideally want if you pressed 1 to call a.view() Then another script perhaps b.sh So if you pressed 2 it would call b.<function_name> S. |
|
|||
|
I'm not 100% sure i get this, is this saying create a libary of functions in another directory then ref this directory using the FPATH and just make calls to the required functions?
So if i have a file functions.sh that contains: editSQLReleaseFile() { clear echo "Editing..." sleep 112 } Then another file (say test.sh) with FPATH set to the location of the functions.sh file i can then make a call to editSQLReleaseFile from within test.sh? i.e. in test.sh echo "calling editSQLReleaseFile" editSQLReleaseFile ? |
|||
| Google The UNIX and Linux Forums |