WHILE SHELL SCRIPT ERROR!

#!/bin/bash
while [ 1 ]
do
        echo "type number or q to quit"
        read n
        [ $n == 'q' ] && exit 0
        i=1;
        while [ $i -lt $n ]
                do
                        echo $i
                        i=$(($i + 1))
                done

done
execute log:
run1.sh: 6: [: 5: unexpected operator
Please some one help me to fix if you fixed i will thank you a lot thanks guys



------------------------------------------------------------------------------
14:06 edit using wrong software i used sh not bash :P
------------------------------------------------------------------------------

留言

這個網誌中的熱門文章

Spanish subject categories