Mercurial > hg > cc > cirrus_home
diff .bash_extras @ 185:acae526510e2
too many overdue updates to break down
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 06 Dec 2023 13:38:58 +0000 |
parents | cac9586291ad |
children |
line wrap: on
line diff
--- a/.bash_extras Fri Sep 08 21:44:48 2023 +0100 +++ b/.bash_extras Wed Dec 06 13:38:58 2023 +0000 @@ -1,82 +1,1 @@ -# Sourced by .bashrc - -cu () -{ - cvs update "$@" | egrep -v '^\?' -} - -lss () -{ - /bin/ls -l "$@" | sort -nr -k 5 -} - -ff () -{ - pat=$1; - shift; - find . -iname "*$pat*" $@ -} - -typecat () -{ - tt=$(type $1); - case $tt in - *\ is\ hashed\ *) - cat $(echo $tt | cut -f 4 -d ' ' | tr -d '()') - ;; - *\ is\ /*) - cat $(echo $tt | cut -f 3 -d ' ' | tr -d '()') - ;; - *) - type $1 - ;; - esac -} - -sus () -{ - sort "$@" | uniq -c | sort -k1nr,1 -} - -uz () -{ - igzip -dc "$@" -} - - -function typecat () -{ - tt=$(type $1) - case $tt in - *\ is\ hashed\ *) cat $(echo $tt | cut -f 4 -d ' ' | tr -d '()') ;; - *\ is\ /*) cat $(echo $tt | cut -f 3 -d ' ' | tr -d '()') ;; - *) type $1 ;; - esac -} - -function tot () -{ - awk '{sum+=$1} END {printf "%u\n",sum}' -} - -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) -if commas: - print(f"{n:,}") -else: - print(n) -' "$@" -} - -export -f cu lss ff typecat sus uz tot btot +/work/dc007/dc007/hst/../shared/.bash_extras \ No newline at end of file