ERROR-> test: argument expected , what does it mean?

I am trying to compare two integer variables in the if statement, but i am getting this "test:argument expected".
What am i missing?
Why is the if loop not executing correctly?

trunkPCM="100000";
more $FILE |while read line
do

PCM=`echo $line | awk '{ print $2 }'`
if [ -n "$PCM" ]
then
echo "$PCM, $trunkPCM";

                    if [ $PMC -eq  $trunkPCM ]
                    then 
                        trunkPCM=$PCM;

fi
fi
done

Thanks for your help!

PCM != PMC

In your test you use the $PMC variable instead of $PCM.

Don't put an ending ; on your script lines.

To read the file, use the following loop:

while read line
do
   . . . . 
done < $FILE

The field 2 can be read directly :

trunkPCM=100000
while read field1 PCM
do
   if [ -n "$PCM]
   then
      echo "$PCM, $trunkPCM"
      if [ $PCM -eq $trunkPCM ]
      then 
         trunkPCM=$PCM
      fi
   fi
done < $FILE

Jean-Pierre.

if [expr $puma ="prod"]
then
pass="null"
echo $pass
fi
What is wrong with this?
I want to check if variable pua has the value prod and if equal assign pass a value of null (string).
this is the error i got.
thanks,
bubeshj

bubeshj,

It seems that you are not putting space characters in where they need to be, however, it's hard to tell for sure, since your code is not wrapped in code tags.
You previously had this:

if [expr $puma ="prod"]

Space it out like this:

if [ expr $puma = "prod" ]

Please use code tags for this reason.

Also, it looks like you are using the "test" program along with "expr", which won't work. The left bracket character ( [ ) is a sort of alias to "test". Get a manual on test ( man test ) to see how this works. Instead of using both, just use 1 of the programs. So change your first line to either:

if [ $puma = "prod" ] ; then

or

if expr $puma = "prod" ; then

Also, expr will print a '1' if true, '0' if false. Use "test" if you don't want the digit to be printed ( or re-direct output ).

Also, since this is a new question, it should probably be a new thread.