Created
April 28, 2012 00:03
-
-
Save m3nd3s/2514437 to your computer and use it in GitHub Desktop.
While example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cat > nt1 | |
#!/bin/sh | |
# | |
#Script to test while statement | |
# | |
# | |
if [ $# -eq 0 ] | |
then | |
echo "Error - Number missing form command line argument" | |
echo "Syntax : $0 number" | |
echo " Use to print multiplication table for given number" | |
exit 1 | |
fi | |
n=$1 | |
i=1 | |
while [ $i -le 10 ] | |
do | |
echo "$n * $i = `expr $i \* $n`" | |
i=`expr $i + 1` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment