Shell script to find the sum of data series

Develop Shell Script to the following: a) To find the sum of data series - 8, 16, 24, 32, 40. b)To Check the given number is divisible by 9 or not.

seq 8 8 40 |awk '{SUM=SUM+$0}END{print SUM; if (SUM %9){print "divisible"}else{print "not divisible"}}'

Was that your homework?


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki