[lug] Bash-ing an FTP log summary

Tony Dyson anorak at comcast.net
Wed Jun 28 18:08:17 MDT 2006


That's very elegant. Some new (to me) constructs to study. Thanks!

Kenneth D. Weinert wrote:
> #!/bin/bash
> 
> declare -i in
> declare -i out
> 
> ((in = 0))
> ((out = 0))
> while read direction amount; do
>     if [ "$direction" ==  "i" ];then
> 	((in += $amount))
>     else
> 	((out += $amount))
>     fi
> done
> 
> echo "Input:  $in"
> echo "Output: $out"



More information about the LUG mailing list