Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

-ne 0 doesn't work -le does

$
0
0
Hi,

I am using korn shell.

Code:

until [[ $# -ne 0 ]]
do
echo "\$# = " $#
echo "$1"
shift
done

To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until [[ $# -le 0 ]] then it does work.

Why numeric comparison is not working with -ne and works with -le?

thank you

Viewing all articles
Browse latest Browse all 16232

Trending Articles