Hi
I trying to make a script that echo 1, if the process that is given to it, is not running. - just a ps command
ps -ef|grep "parameter"
The problem is that I need to give it several parameters
ps -ef|grep "parameter1" |grep "parameter2"
this ex. has 2 parameters
ProcessExists.ksh "test" "test 2" - the ps command should then be something like this
ps -ef|grep "test" |grep "test 2"
I've tryede to make a script that runs throu the parameters - but I can't get them to echo out the parameter.
#!/bin/ksh
i=0
Item=1
while [ $i -lt $# ]
do
echo $Item " Item"
parm="$"$Item;echo `echo $parm`
echo $$Item
(( Item=$Item+1 ))
i=$((1+i))
done
I trying to make a script that echo 1, if the process that is given to it, is not running. - just a ps command
ps -ef|grep "parameter"
The problem is that I need to give it several parameters
ps -ef|grep "parameter1" |grep "parameter2"
this ex. has 2 parameters
ProcessExists.ksh "test" "test 2" - the ps command should then be something like this
ps -ef|grep "test" |grep "test 2"
I've tryede to make a script that runs throu the parameters - but I can't get them to echo out the parameter.
#!/bin/ksh
i=0
Item=1
while [ $i -lt $# ]
do
echo $Item " Item"
parm="$"$Item;echo `echo $parm`
echo $$Item
(( Item=$Item+1 ))
i=$((1+i))
done