Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Basic
- for i in {1..5}
- do
- echo "$i"
- done
- #Basic and leading zero
- for num in {1..5}
- do
- value=$(printf "%02d" $num)
- echo $value
- done
- # Countdown - BOOM !!
- START=1
- END=5
- echo "Countdown"
- for (( c=$START; c<=$END; c++ ))
- do
- echo -n "$c "
- sleep 1
- done
- echo
- echo "Boom!"
- ## save $START, just in case if we need it later ##
- i=$START
- while [[ $i -le $END ]]
- do
- echo "$i"
- ((i = i + 1))
- done
- ## define an array ##
- arrayname=( Dell HP Oracle )
- ## get item count using ${arrayname[@]} ##
- for m in "${arrayname[@]}"
- do
- echo "${m}"
- # do something on $m #
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement