Started övning 4, labb 6

This commit is contained in:
2013-12-19 15:29:29 +01:00
parent 71534704f2
commit b446f85659
7 changed files with 171 additions and 0 deletions

29
Labb6/test_func.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Jack-Benny Persson
# LX13
# Testing functions
Nr1=$1
Nr2=$2
# Sanity checks
if [ $# -ne 2 ]; then
echo "`basename $0` requires two arguments (integers)"
exit 2
fi
# Functions
add()
{
Sum=$((Nr1+Nr2))
return $Sum
}
# Main
add
echo $?
echo "Nr1 contained ${#Nr1} chars, Nr2 contained ${#Nr2}"
exit 0