Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/bash
- # Note, "[[ ]]" and "if [] && []" is bash/ksh88 ONLY
- if [ -z ${1} ]; then tweetnum=1
- elif [[ ${1} =~ ^[0-9]+$ ]] ; then
- if [ ${1} -gt 0 ] && [ ${1} -lt 11 ]; then tweetnum=$1
- else echo "Number outside of range 1..10"; exit 0;
- fi
- else echo "That's not a number. Please use a number in the range 1..10"; exit 0;
- fi
- echo "Tweet # ${tweetnum}"
Add Comment
Please, Sign In to add comment