B"H

Not a perfect solution, but you could always use cut to lop off the
cents. Something like:

cat $TMP_FILE | while read SSN AMT; do {
   CENTLESS_AMT=`echo $AMT |cut -f1 -d.`
   CENTLESS_LIMIT=`echo $limit|cut -f1 -d.`
   if [ $CENTLESS_AMT -gt $CENTLESS_LIMIT ] ; then
         echo $AMT         $SSN
    fi
} done

I don't know if backticks work in cshell.

Menachem

On 11/7/05, Nestor <[EMAIL PROTECTED]> wrote:
> People,
>
> I am running a script and I am trying to compare 2 values.
>
> The input file looks like
> 111-11-1111|        24000.00
> 222-22-2222|        32560.15
> 333-33-3333|        45678.90
>
> The script loks like this
> ----------------------------------------------------
> TMP_FILE = "myfoo"
> IFS = '|'
>
> cat $TMP_FILE | while read SSN AMT; do {
>      if [ $AMT -gt $limit ] ; then
>           echo $AMT         $SSN
>      fi
> } done
> ---------------------------------------------------
> The warning is:
> + read SSN AMT
> + '[' 14402.40 -gt 90000.00 ']'
> nestor2.sh: line 50: [: 14402.40: integer expression expected
>
> How do you compare 2 float in shell script preferrable in cshell?
>
> Thanks,
>
> Nestor :-)
>
>
> --
> [email protected]
> http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
>


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to