hi guys have this little problem, need some help from script gurus.
basically I'm running hpux cmviewcl command, cmviewcl command will produce
db1pkg up running enabled box1
my script
PSV='box1'
STAT='up'
check_db1pkg()
{
# assign cmviewcl output to x
x=`cmviewcl | grep db1pkg`
#
# setup an array 'ARR' to do matching
#
set -A ARR $x
#test 'up'
if [${ARR[1]} -ne ${STAT}] -o [${ARR[4]} -ne ${PSV}];then
send_sms;
else
echo "db1pkg all fine as at `date`" > /var/tmp/heartbeat
fi
when I run this script it will says
check_db1pkg[9]: [up: not found
am I missing or did something wrong here?