And operator

I am trying to check two variables and if both are blank I want to set a flag:

the_f3_pid=`rsh $target ps -ef | grep "f3.eab" | awk '{print $2}'`
the_f7_pid=`rsh $target ps -ef | grep "f7.eab" | awk '{print $2}'`

if [ "$the_f3_pid" = "" && "$the_f7_pid = "" ] ; then
  y=1
fi

I get an error:

./script_name[18]: test: 0403-021 ] character is missing.

the_f3_pid and the_f7_pid are both blank since the software is not running on the machine I am checking.

Any ideas ?

Thanks,
RC

Is appears if I use and instead of && that it works ok.

Change
"$the_f7_pid
to
"$the_f7_pid"

Also change
&&
to
-a

change '&&' to '-a'

You can also do the work without using the and operator :

if [ "$the_f3_pid$the_f7_pid" = "" ] ; then
  y=1
fi