Unix statement

Joel J.J. Heber

New Member
Here goes , I created a FIFO layer program that crunches the database and our data general minicomputer pretty good. The weighed I-O goes to about 25%.

I would like to create a little script in Unix to monitor usage:

Something as such:

test = 'mpsar 1 3' | grep -d " " -f 16 ; export test

blah blah

Anyhow I get the weighed IO into the test variable, if the variable is higher than say 30% the program will terminate to the man menu with a message.

Should I just do a series of Unix statements in prorgess or should I run a script in unix....

I am just not sure on how to import the variable.

hmmmmmmmm *scratches head*

I am a newbie so any help is much appreciated.
 

Joel J.J. Heber

New Member
Update

Well I found that I can use the:

Input Through statement

, to bring in my values.

This is very useful, hmmm you can ls and lookif files exist in the directory, get process id's, $path, the posibilities are endless.

Thanks

Joel:D
 

Joel J.J. Heber

New Member
HELPPPPPPPPPPPp

ok here goes

mpsar 1 1 | cut -d " " -f 16

not grep....my bad....

but it does not give me the 16th field.....like it should

how else could I go fetch the 16th field of this output....

:confused:
 
U

Unregistered

Guest
You can try this:-

set `mpsar 1 1|tail -1`
eval echo \$${#}

I don't have mpsar on any of the machines here, so I don't know about any heading lines.
Remove the |tail -1 if mpsar doesn't print heading lines.

HTH
 
U

Unregistered

Guest
oops

Forgot Bourne shell has a limit of 9 positional parameters.

You need Korn shell

put this line at the start of the script

#!/usr/bin/ksh

set `mpsar 1 1|tail -1`
eval echo \$${#}
 
Top