如果在while循环中无法实现

时间:2014-11-08 22:12:04

标签: bash if-statement while-loop

请帮助我。我无法在WHILE中实现IF:

    while IFS=';' read one two three; 
do

if (( $three >= 1 )) #this is a line that i can't understand

then X=$(for i in $two
   do BIN=$(echo "obase=10; ibase=16; $i" | bc )
   echo $BIN
   done)
fi
done < /testcsv.csv

,输出为:

./test.sh: line 34: ((: <= 1 : syntax error: operand expected (error token is "<= 1 ")

1 个答案:

答案 0 :(得分:0)

bash中IF的语法如下:

if [ conditional expression ]

在你的情况下:

if [ $three >= 1 ]