Signal9Signal9 — home
online
back to labs

Dojo: Sum a Column

MediumOne-Liner Dojo5-10 min
The brief

The file /root/nums.txt has one integer per line. In ONE line, compute their TOTAL and write just the number to /root/answer.txt.

This is where awk earns its keep: it can accumulate across lines and print a result at the END. No paste/bc gymnastics needed.

What you'll do
  • Write the sum of the integers in /root/nums.txt to /root/answer.txt, in one line

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.