Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
Below script has some errors can any one help#!/bin/ksh
#cdstat1.sh
for file in send*.log
do
if [ -f ${file} ]
then
echo "`grep /ripsapps/ripsu/data/out "${file}"`" | cut -d "/" -f7 >> temp
grep "Process Number" "${file}"| cut -d "=" -f2 >> temp
pnum=`grep "Process Number" "${file}"| cut -d "=" -f2`
echo "$pnum"
set -v
ndmcli << EOJ > table
select statistics pnumber=$pnum;
EOJ
for CCOD in `cat table | awk '{print $7}'`
do
if [ $CCOD="0" ]||[ $CCOD="2" ]||[ $CCOD="4A" ]
then
echo "Success" >>temp
if [ $CCOD="8" ]
then
echo "Failure" >>temp
fi
fi
done
else
exit
fi
done
----------------
This one of log Files in which I have to grep filename “nonramp.d20030716”&Process Number “16235” inside a file-."send_rpsrv_attlabs.log" 26 lines, 893 characters
******************************************************
* *
* CONNECT:Direct for UNIX *
* *
* Copyright (c) 1983, 1997 Sterling Commerce, Inc. *
* Version 3.1.00 GA *
******************************************************Direct> Enter a ';' at the end of a command to submit it. Type 'quit;' to exit CLI.
submit RPATTRV process snode=RELAYAL
step2 copy from (file=/ripsapps/ripsu/data/out/rpsrv/nonramp.d20030716
pnode)
ckpt=no
to (file=nonramp.d20030716
snode)
if (step2 = 0) then
run job snode sysopts="bin/relay ninguai nonramp.d20030716"
eif
pend;Process Submitted, Process Number = 16235
Direct>
CONNECT:Direct CLI Terminated...
--------------------
Below should be the output of the script “
set -v
ndmcli << EOJ > table
select statistics pnumber=$pnum;
EOJ”
Then ,this output has to be copied to another file to extract a column “CCOD”
To check the status of the file.Direct> select statistics pnumber=16235;
===============================================================================
SELECT STATISTICS
===============================================================================
P RECID LOG TIME PNAME PNUMBER STEPNAME CCOD FDBK MSGID
E RECID LOG TIME MESSAGE TEXT
---------------------
E RNCF 07/18/2003 11:06:10 Attempt to connect to remote node RELAYAL failed.
E RNCF 07/18/2003 11:43:15 Attempt to connect to remote node RELAYAL failed.
E SSTR 07/18/2003 11:43:45 Session started, SNODE:relayal
P PSTR 07/18/2003 11:43:45 RPATTRV 16235 0 XSMG200I
P XSMG 07/18/2003 11:43:45 RPATTRV 16235 8 XSMG242I
E PSAV 07/18/2003 11:43:45 Process returned to tcq.
E SEND 07/18/2003 11:43:45 Session ended, Session Manager shutting down SNODE:
relayal
===============================================================================
Select Statistics Completed Successfully.Check my script tell me any error & adjustments to be made
David Perry asked me to send my data file
Thank u
Anu

How's this?
#!/bin/sh
function NDMCLI {
# $pnum = $1
ndmcli << EOJ > table
select statistics pnumber=$1;
EOJ¦
}for file in `grep -l /ripsapps/ripsu/data/out *` ; do
pnum=`awk -F"=" '/Process Number/ { print $2 }' $file`
NDMCLI $pnum
case `awk '/P XSMG/ { print $7 }' table` in
0 | 2 | 4A )
echo "Success for Process Number $pnum" >> temp
;;
8 )
echo "Failure for Process Number $pnum" >> temp
;;
esac
done

hi,
David your function can't be called .Moreover u have changed my script
below script shouldn't be cahanged.
"set -v
ndmcli << EOJ > table
select statistics pnumber=$pnum summary=no;
EOJ"
try to give some idea.thank u
thank unanda

![]() |
logging to UNIX by UDP po...
|
To run the bat file
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |