for

for n in 1 2 3 4 5
do
    echo n
done

while

index=100
while [ $index -lt 106 ]
do
    index=`expr $index + 1`

    if [ $index -eq 103 ];then
        continue
    fi

    echo $index
done

until

index=100
until [ ! $index -lt 106 ]
do
    echo $index
    if [ $index -eq 103 ];then
        break
    fi
    index=`expr $index + 1`
done

if elif else fi

if [ $a == 1 ]
then
    echo 'hello ==1'
elif [ $a -lt 1 ]
then
    echo '<1'
else
    echo '>1'
fi

function

hello(){
    echo $1
    echo $*
    echo $#
}

hello 1 2 3 4 5 10

results matching ""

    No results matching ""