Linux变量和控制语句


数组:

# a = (a b c d e)

# echo ${a[0]}

# echo ${a[*]}

# echo ${a[@]}

b[0] = 1

if 语句:

a = 20

b =10

if [ $a -eq $b ]; then echo "=";fi

for语句:

for loop in 1 2 3 4 5

do

  echo "hello"

done

while语句:

while(condition)

do

  echo ""

done