title: expr non-numeric argument shell script
body: <p>The below check is not working:</p>
  
  <pre><code>if [ $LEN = `expr $CNPROC + $CTotal` ])
  </code></pre>
  
  <p>and returns <code>expr non-numeric argument shell script</code>.</p>
  
  <p>Always it is going to else. Please tell me what is the mistake.</p>
  
  <p>Earlier I was not using while so the same thing was working fine now suddenly when I did put it in the while loop it is no working.</p>
  
  <pre><code>#!/usr/bin/ksh 
  echo "`${BOLD}`    ***** Checking Memory Utilization User*****`${UNBOLD}`"
  echo "==================================================="
  
  IFS='|'
  cat configMachineDetails.txt | grep -v "^#" | while read MachineType UserName MachineName
  do
      export MEMORY_USAGE1=`ssh -f -T ${UserName}@${MachineName} prstat -t -s rss 1 2 | tr '%' ' '| awk '$5&gt;5.0'`
      export LEN=`echo "$MEMORY_USAGE1"|wc -l`
      export CNPROC=`echo "$MEMORY_USAGE1"|grep "NPROC"|wc -l`
      export CTotal=`echo "$MEMORY_USAGE1"|grep "Total"|wc -l`
  
      if [ $LEN = `expr $CNPROC + $CTotal` ]
      then
          echo "`${BOLD}`**************All usages are normal !!!!!! *************`${UNBOLD}`"
      else
          echo "`${BOLD}`**** Memory(%) is more than 5% in MachineType $MachineType  UserName $UserName
   MachineName  $MachineName   *******`${UNBOLD}`"
          echo "===================================================="
          echo "$MEMORY_USAGE1"
      fi
  done
  </code></pre>