Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,20 @@
bash>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"