szaydel
6/17/2019 - 6:30 PM

Python one liners

# Take a column of floats from a file and sum. This was written with strace in
# mind, specifically dealing with timestamps at the end of each traced syscall.
python -c 'import sys ; print(sum(
    (
    float(x) for x in (n.strip() for n in sys.stdin.readlines()) if not x == "---"
    )
    ))' < ./stats.txt