Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,20 @@
exec 0<"$1" # open the input file on stdin
exec 1>"$1.new" # open an output file on stdout
{
read -r header
echo "$header,SUM"
IFS=,
while read -r -a numbers; do
sum=0
for num in "${numbers[@]}"; do
(( sum += num ))
done
# can write the above loop as
# sum=$(( $(IFS=+; echo "${numbers[*]}") ))
echo "${numbers[*]},$sum"
done
} &&
mv "$1" "$1.bak" &&
mv "$1.new" "$1"