![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Invoking Oracle stored procedure in unix shell script | hidnana | Shell Programming and Scripting | 1 | 10-15-2008 07:37 AM |
| returning to the parent shell after invoking a script within a script | gurukottur | Shell Programming and Scripting | 5 | 09-26-2006 07:05 AM |
| Invoking Shell Script via php | bubeshj | Shell Programming and Scripting | 2 | 06-30-2006 06:09 AM |
| Invoking shell script from html/jsp page | bubeshj | Shell Programming and Scripting | 2 | 06-28-2006 01:53 PM |
| Wrong Shell Invoking My Script On Linux | kowrip | Shell Programming and Scripting | 3 | 09-10-2003 10:18 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
invoking one shell script from other
hi,
i am one day old in shell scritpting. how to invoke one shell script from the other? For eg.i have two shell scripts A.sh and B.sh. Inside A.sh i need to invoke B.sh and the return code of A.sh should be the value returned by B.sh. it would be better if you provide any sample shell scripts. Thanks, Ajay. |
|
||||
|
1.
A.sh call B.sh just put B.sh as a command in the shell script e.g. cp ... ... ls ... ... B.sh etc... Remeber the user running the script must also has execute permission for B.sh 2. The return value of A.sh is controlled by either exit <value> or the return code of the last command so if B.sh was you last command in A.sh then the return code of B.sh = return code of A.sh However if you have more commands after B.sh in the script, you can save the return value of B.sh using B.sh retcode = $? .... .... exit $retcode (differs for whatever shell you use but $? is the return code of your last command.) Hope it helps |
|
||||
|
invoking one shell script from other
Thanks for your reply. but still i am having some doubts
i went through some of the websites. its quoted that "use $? very rarely". is it a good practice to use this? (pradon me if i am wrong i dont have much idea in scripting) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|