replacing -lt with -ge didn't gave any error ?. It's strange .
By the way, it doesn't serve my logic. So when I changed -ge back to -lt, everything now runs fine.
It's not the first time it's happening. Why is that so, gives errors and runs smoothly without any change. tale a look on my now working code, and see if there is any difference.
max=`head -1 $1`
for file_name in $* ## $* returns all arguments ##
while read num ## Read Line by Line the file ##
echo "DEBUG: \$max is '$max', \$num is '$num'"
if [ $max -lt $num ]; then
echo $max > file.tmp
done < $file_name
Thanks for your quick reply.
can you or anybody please explain this uncertain behaviour of test command ?
it always consumes my lot of time.
any help is much appreciated.