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.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
TGN(1) TGN(1)
NAME
tgn - a network traffic generator
SYNOPSIS
tgn [-V] [-v] [-l] [-s random seed] [-w PCAP filename] [-o output speaker] [-c packet count] [-h] [PDU definition]
DESCRIPTION
tgn is a network traffic generator. It is command-line interface (CLI) program that does the same thing as the send_network command of the
Network Expect framework. Refer to nexp(1) for additional details regarding the send_network command.
The only mandatory option is a PDU definition.
The -c switch allows to specify the number of packets to send. If -c is not provided then the number of packets to send is calculated
automatically based on the PDU definition.
-V causes tgn to print its version number and exit.
The -s flag allows to specify a random seed that will cause predicatibility of pseudo-random numbers generated by tgn during execution of a
script. In cases where tgn is used as a protocol fuzzer, this option is useful to be able to re-generate a specific test case.
-v increases the verbosity level. Additional information may be displayed when the verbosity level is higher.
The -l flag causes tgn to display all available network speakers and exit. See nexp(1) for a discussion of network speakers.
The -o flag allows to select a specific network speaker for output. Use the -l option to list available speakers. By default, the "ip"
speaker (kernel-routed IP packet delivery) is tried first and if it is not available, which can happen if tgn is not run with root
privileges, the "hex" speaker is used.
The PDU definition is a string that defines a PDU. It uses libpbuild PDU syntax.
EXAMPLES
shell# tgn -o eth0 "ip(dst = 192.168.1.1)/icmp-echo(id = 'random')"
shell# tgn "ip(src = 192.168.0.1, dst = <192.168.0.10, 192.168.0.11>,ttl = <1, 2>)/"
"tcp(src = 'random', dst = 22..25, window = 16384,syn, seq = 'random', ack-seq = 0)"
shell# tgn -w /tmp/cap -c 5 "ether()/ip(dst = 1.2.3.4++)/icmp-echo(seq = 0++)"
&& wireshark /tmp/cap
BUGS
tgn has not been ported to Microsoft Windows.
VERSION
This man page is correct for version 1.0 of tgn.
SEE ALSO
nexp-numspec(1), nexp-payload(1), nexp-ether(5), nexp-gre(5), nexp-ip(5), nexp-mpls(5), nexp(1)
AUTHOR
Network Expect was written by Eloy Paris <peloy@netexpect.org>. However, Network Expect borrows ideas from lots of Open Source tools like
Nemesis, Packit, hping, Expect, and Scapy. The Network Expect author is indebted to the authors of these tools for their contribution.
This man page was written by Eloy Paris.
09 September 2009 TGN(1)