Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
|
|
@ -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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue