$1 issue with prstat

$1 issue with prstat

am 25.01.2008 01:08:28 von zw

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.

Re: $1 issue with prstat

am 25.01.2008 13:42:12 von Bill Marcum

On 2008-01-25, zw 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".