# HG changeset patch # User Henry S. Thompson # Date 1635801793 0 # Node ID 2b59f3ef229473722e663f710e86f4549bff2ad9 # Parent 0072e4ee6c678254512ae80684d20c759dfe18dc add -c switch to btot diff -r 0072e4ee6c67 -r 2b59f3ef2294 .bashrc --- a/.bashrc Thu Oct 28 12:11:08 2021 +0000 +++ b/.bashrc Mon Nov 01 21:23:13 2021 +0000 @@ -89,14 +89,21 @@ btot () { python3 -c 'import sys +commas = False +if len(sys.argv)>1: + if sys.argv[1]=="-c": + commas = True n=0 for l in sys.stdin: try: n+=int(l) except ValueError as e: print(e,file=sys.stderr) -print(n) -' +if commas: + print(f"{n:,}") +else: + print(n) +' "$@" } function uz () { $G/usr/bin/igzip -dc "$@" ; }