Bash Script Programming

Reference

 

Branch and Loop

if [ -e . ]        # equivalent to if test -e .
then
    echo "Yes"
else
    echo "No"
fi
for fn in tom dick harry; do
    echo "$fn"
done
y=1
while [ $y -le 12 ]; do
    x = 1
    while [ $x -le 12 ]; do
        printf "%4d" $(( $x * $y ))
    eone
    echo ""
    let y++
done

User Input

Array

Advertisements