more bash examples

This commit is contained in:
Marina Wahl 2014-07-01 19:51:31 -04:00
parent 68e3f7d899
commit 4b0a965e4a
9 changed files with 199 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#! /bin/bash
# script to test for loop and arguments
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
for i in 1 2 3 4 5 6 7 8 9 10
do
echo "$n * $i = `expr $i \* $n`"
done