$1 issue with prstat

Hi

I have 2 simple unix scripts.

test_prstat
---------------
#!/bin/sh

# Find out JAVA pid
echo "Starting prstat."
pid=`ps -ef|awk '/'"java -server -XX:CompileThreshold"'/ && !/bash/
{print $2}'`
echo "pid = $pid"
../prs $pid > prs.log &
echo "pid = $pid"


prs
----
prstat -c -n 1 10 -p $1



# ps -ef | grep java
root 26129 1 0 16:03:57 pts/20 2:11 /opt/bea/jdk150_10/bin/
java -serv
er -XX:CompileThreshold=8000 -XX:PermSize=48m
root 26169 26003 0 16:06:12 pts/26 0:00 grep java



But I'm getting output
# test_prstat
Starting prstat.
pid = 26129
pid = 26129
# prstat: illegal argument -- -p


What am I doing wrong ?

Any help is appreciated.
zw [ Fr, 25 Januar 2008 01:08 ] [ ID #1915884 ]

Re: $1 issue with prstat

On 2008-01-25, zw <MPC8250 [at] gmail.com> wrote:
>
>
> But I'm getting output
> # test_prstat
> Starting prstat.
> pid = 26129
> pid = 26129
> # prstat: illegal argument -- -p
>
>
> What am I doing wrong ?
>
prstat does not accept the -p argument. Check your $PATH to see if there
is more than one prstat command. Read the man page and try
"prstat --help" or "prstat -h".
Bill Marcum [ Fr, 25 Januar 2008 13:42 ] [ ID #1915912 ]
Linux » comp.unix.shell » $1 issue with prstat

Vorheriges Thema: Re: uniq without sort <-------------- GURU NEEDED
Nächstes Thema: Sar's data in a web's browser