Blob
1 #!/usr/local/plan9/bin/rc3 . 9.rc5 fn text {6 if(~ $winid [0-9]*)7 9p read acme/$winid/body8 if not if(~ $text9term unix!*)9 dial -e $text9term </dev/null10 if not11 status=''12 }14 PROMPT='[^ ]*[%;$#][ ]+'16 fn cmds {17 text | sed -n 's/^'$PROMPT'([^"])/ \1/p'18 }20 switch($#*) {21 case 022 cmds | tail -123 case *24 cmds | grep '^ '^$"* | {echo; cat} |25 pr -t -n | sort -nr | sort -u +1 | sort -n |26 sed 's/^ *[0-9]+ //' | grep .27 }29 # the silly {echo; cat} gets around pr printing "empty file" when30 # presented with no input.