check exit status - Expect Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting check exit status - Expect Script
# 1  
Old 12-31-2007
check exit status - Expect Script

from my main script, i am calling an expect script. there are a lot of conditions in the Expect script and it can have any exit value based on success or failure of the Expect Script. how can i check the exit status of Expect scritp in the main script.
# 2  
Old 01-02-2008
what's an expect script?
i don't understand it but you can check the exit status of any process
by checking $? right after you call the script.
For instance:

expect_script
if [ $? -eq 0 ]
#script returns OK
else
#script returns ERROR
fi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inner script run and its exit status

Main Script #!/bin/ksh echo "Maimn script" ./clocal/www/web-data/WAS/WebSphere7/scripts/DealerLocator/Scripts/secondscript.ksh echo "$? = status" Sdecond Script #!/bin/ksh echo "In second SCript" exit 1 Output: Maimn script ./testmain.ksh:... (4 Replies)
Discussion started by: dineshaila
4 Replies

2. Shell Programming and Scripting

Exit status in the script

Hi all, I am trying to use a script (a.sh) which is calling another script(b.sh). And I want to use the exit code(set by me) of b.sh in a.sh. I am using this in b.sh #!/bin/sh <-- code --> if ; then exit 0 else exit 1 fiBut... (2 Replies)
Discussion started by: Raj999
2 Replies

3. Shell Programming and Scripting

Check/get the exit status of a remote command executed on remote host through script

Geeks, Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s). Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies

4. Shell Programming and Scripting

exit status from the script is always 0

Hi , I have a bash script , which does the network configuration. Messages from this script are dumped on console as well as stored in a log file . This script is invoked from a C code using system call . The script returns different exit code , to indicate different error cases. The... (1 Reply)
Discussion started by: abhirai
1 Replies

5. Shell Programming and Scripting

Check the exit status in a pipe call

Guys, I have a problem :confused: and I need some help: I've to process many huge zip files. I'd code an application that receive the data from a pipe, so I can simple unzip the data and send it (via pipe) to my app. Something like that: gzip -dc <file> | app The problem is: How can I... (7 Replies)
Discussion started by: Rkolbe
7 Replies

6. Shell Programming and Scripting

How to check exit status of unset variables

Hi All, Is there any way to check exit status of unset variables? In the following code PathX is not set and the script terminates without checking exit status. #!/bin/bash Path="/tmp/log" cd ${PathX:?} if ;then echo "Exit Status : non zero" else echo "Exit Status :... (2 Replies)
Discussion started by: sussus2326
2 Replies

7. Shell Programming and Scripting

Check DB Status using expect

Hi all, I am using expect (novice) and would like to check a DB status before kicking off a batch job. Can anyone help me with such code? Just a simple check to see if the database is up and running would be suffice. Thanks (2 Replies)
Discussion started by: Hopper_no1
2 Replies

8. Shell Programming and Scripting

Check for exit status

Hi I have following code I want If whole code executes successfully then return true If found any error then print the error I tried if ; then But this checks only for the just upper line execution #!/bin/bash PATH1=/var/log/mysql PATH2=/home/ankur/log FILE1=mysql-bin.index... (4 Replies)
Discussion started by: kaushik02018
4 Replies

9. Shell Programming and Scripting

check exit status of bg scripts

HI All, I am running one shell script, in that script i am calling 4 scripts in the background. abc.ksh & efg.ksh & xky.ksh & mno.ksh & please let me know, how could i find the success and failure of each script. i Cannot use $?, because i want to run all the scripts in parellel. ... (2 Replies)
Discussion started by: javeed7
2 Replies

10. UNIX for Dummies Questions & Answers

how to check exit status in awk script

Hi, I have a main program which have below lines - awk -f test.awk inputFileName - I wonder how to check status return from awk script. content of awk script: test.awk --- if ( pass validation ) { exit 1 } else { (1 Reply)
Discussion started by: epall
1 Replies
Login or Register to Ask a Question