Sponsored Content
Top Forums Shell Programming and Scripting Invoking shell script from shell script Post 11368 by LivinFree on Tuesday 4th of December 2001 12:35:12 AM
Old 12-04-2001
That looks about right to me...
To paraphrase:

Code:
(...)
/path/to/other/script
case $? in
0) Do something ;;
*) Do something else ;;
esac
(...)

or:
Code:
(...)
/path/to/other/script
if [ "$?" -ne "0" ]; then
freak out here
fi
(...)

There are several different ways of doing what you need.

Hope that helps.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Wrong Shell Invoking My Script On Linux

I have a shell script that does NOT have the '#!' line at the top. It is written for ksh. The shell in my passwd entry is '/usr/bin/ksh' and my SHELL env variable is '/usr/bin/ksh'. Now, here's the issue. I invoke the script on Solaris with './myprog'. This works fine. I also run the same... (3 Replies)
Discussion started by: kowrip
3 Replies

2. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: ajay xavier
3 Replies

3. Shell Programming and Scripting

Invoking shell script from html/jsp page

I want to invoke shell script named bubesh.sh when submit button clicked on html/jsp page.I am using an apache server and the html & shell script are in the same working directory.Please help. (2 Replies)
Discussion started by: bubeshj
2 Replies

4. Shell Programming and Scripting

Invoking Shell Script via php

list me commands to invoke a shell script from php once the submit button is clicked in the php page. Requirement is Once a submit button is clicked it should run a script that displays the outcome of the script in a html/php. Please help. Thanks in Advance, BubeshJ (2 Replies)
Discussion started by: bubeshj
2 Replies

5. Shell Programming and Scripting

returning to the parent shell after invoking a script within a script

Hi everybody, I have a script in which I'm invoking another script which runs in a subshell. after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Discussion started by: gurukottur
5 Replies

6. Shell Programming and Scripting

invoking a shell script inside cgi shell script

Hi, I have an HTML form through which I get some text as input. i need to run a shell script say script.sh inside a perl-cgi script named main_cgi.sh on the form input. I want to write the contents of the form in a file and then perform some command line operations like grep, cat on the text... (2 Replies)
Discussion started by: smriti_shridhar
2 Replies

7. UNIX for Advanced & Expert Users

Invoking shell script with perl command.

Hi All, I am using the following command to invoke the shell script from a perl command. perl -i.bak -pe'BEGIN { $cmd = "/opt/coreservices/tomcat-5.5.9/bin/digest.sh -a sha"; } s/(password=")(*)/ $1.`$cmd $2|cut -d: -f2|tr -d "\n"` /e ' $CATALINA_HOME/conf/tomcat-users.xml I need... (1 Reply)
Discussion started by: nua7
1 Replies

8. Shell Programming and Scripting

Invoking one shell script from another unix box

Hello All, I have a shell script A which is in one unix box. Also i have a script B in another unix box. Now i'm struggling to find a way to invoke A shell script from B shell script. Is it possible to do this in any way..Request you anybody please help me in this point. Thanks in advance. (6 Replies)
Discussion started by: RSC1985
6 Replies

9. Shell Programming and Scripting

Problem invoking shell script

whats wrong here?! ________________ #!/bin/sh # FILE: clean_dirs # GOAL : To clean up directories used in Oracle processing # LANGUAGE : shell script (sh) # PARAMETERS : Input_File # 11/07/02 acri - modified to cd into the directory so it will... (7 Replies)
Discussion started by: gillraj
7 Replies

10. Shell Programming and Scripting

Invoking Application in Shell Script

Hi All, I have a scenario : 1. A list of servers naming server21, server 22, server 23 etc. This list of servers is separate for my environments. Env1 has 3 server Env2 has 5 serves Env3 has 10 servers 2. Each server accesses application through which I want to invoke some method. So... (7 Replies)
Discussion started by: ankur328
7 Replies
script(5)							       Files								 script(5)

NAME
script - Boot script DESCRIPTION
The boot script describes how the Erlang runtime system is started. It contains instructions on which code to load and which processes and applications to start. The command erl -boot Name starts the system with a boot file called Name.boot , which is generated from the Name.script file, using sys- tools:script2boot/1 . The .script file is generated by systools from a .rel file and .app files. FILE SYNTAX
The boot script is stored in a file with the extension .script The file has the following syntax: {script, {Name, Vsn}, [ {progress, loading}, {preLoaded, [Mod1, Mod2, ...]}, {path, [Dir1,"$ROOT/Dir",...]}. {primLoad, [Mod1, Mod2, ...]}, ... {kernel_load_completed}, {progress, loaded}, {kernelProcess, Name, {Mod, Func, Args}}, ... {apply, {Mod, Func, Args}}, ... {progress, started}]}. * Name = string() defines the name of the system. * Vsn = string() defines the version of the system. * {progress, Term} sets the "progress" of the initialization program. The function init:get_status() returns the current value of the progress, which is {InternalStatus,Term} . * {path, [Dir]} where Dir is a string. This argument sets the load path of the system to [Dir] . The load path used to load modules is obtained from the initial load path, which is given in the script file, together with any path flags which were supplied in the command line arguments. The command line arguments modify the path as follows: * -pa Dir1 Dir2 ... DirN adds the directories Dir1, Dir2, ..., DirN to the front of the initial load path. * -pz Dir1 Dir2 ... DirN adds the directories Dir1, Dir2, ..., DirN to the end of the initial load path. * -path Dir1 Dir2 ... DirN defines a set of directories Dir1, Dir2, ..., DirN which replaces the search path given in the script file. Directory names in the path are interpreted as follows: * Directory names starting with / are assumed to be absolute path names. * Directory names not starting with / are assumed to be relative the current working directory. * The special $ROOT variable can only be used in the script, not as a command line argument. The given directory is relative the Erlang installation directory. * {primLoad, [Mod]} loads the modules [Mod] from the directories specified in Path . The script interpreter fetches the appropriate mod- ule by calling the function erl_prim_loader:get_file(Mod) . A fatal error which terminates the system will occur if the module cannot be located. * {kernel_load_completed} indicates that all modules which must be loaded before any processes are started are loaded. In interactive mode, all {primLoad,[Mod]} commands interpreted after this command are ignored, and these modules are loaded on demand. In embedded mode, kernel_load_completed is ignored, and all modules are loaded during system start. * {kernelProcess, Name, {Mod, Func, Args}} starts a "kernel process". The kernel process Name is started by evaluating apply(Mod, Func, Args) which is expected to return {ok, Pid} or ignore . The init process monitors the behaviour of Pid and terminates the system if Pid dies. Kernel processes are key components of the runtime system. Users do not normally add new kernel processes. * {apply, {Mod, Func, Args}} . The init process simply evaluates apply(Mod, Func, Args) . The system terminates if this results in an error. The boot procedure hangs if this function never returns. Note: In the interactive system the code loader provides demand driven code loading, but in the embedded system the code loader loads all the code immediately. The same version of code is used in both cases. The code server calls init:get_argument(mode) to find out if it should run in demand mode, or non-demand driven mode. SEE ALSO
systools(3erl) Ericsson AB sasl 2.1.9.3 script(5)
All times are GMT -4. The time now is 07:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy