infinite ksh shell loop with count
So .. no thrills no frills. If you are searching for this .. you know what you are looking at and can modify this as needed. #!/usr/bin/ksh export PATH=$PATH:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/bin DATE=`date ‘+%Y.%m.%d_%H.%M.%S’` count=1 while true do echo ${count} (( count++ )) if [[ ${count} -eq 11 ]]; then count=1 fi sleep 1 done This script will […]
Awk Tips Tricks
Awk to sort by line length: $ wc -l /usr/share/dict/words 483523 /usr/share/dict/words $ awk ‘{ print length(), $0 | “sort -n” }’ /usr/share/dict/words Remove blank lines and print the 7th field awk ‘NF > 1 {print $7}’ input Quick Combo Demonstration: # cat /tmp/freemem.drmets total used free shared buffers cached Mem: 125 9 115 0 […]