#!/bin/bash
#===============================================================================
#
#          FILE: allsum
#
#         USAGE: allsum
#
#   DESCRIPTION: Print summed value from the Standard Input
#
#          BUGS:  ---
#        AUTHOR: rickz (Rick Zhang), xlrickz@gmail.com
#       COMPANY: X-LEGEND Entertainment Corp.
#       CREATED: Wed May  2 12:35:53 KST 2012
#      REVISION: 1.0
#
#          TODO:
#
#===============================================================================

#set -o nounset                              # Treat unset variables as an error
#set -m                                      # Enable job control

echo $((
	$(
		for number in $(cat);do 
			echo $number+
		done \
		| grep "[0-9]" \
		| tr '\n' '+'
	)0
))
