diff options
-rwxr-xr-x | sum.sh | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -0,0 +1,13 @@ +#!/bin/bash + +echo -n "$1" + +for i in $*; do + if [ ! $i -eq 1 ]; then + echo -n " + $i" + fi + sum=$(($sum + $i)) +done + +echo " = $sum" + |