Blob
1 #!/usr/local/plan9/bin/rc3 fn text {4 if(~ $winid [0-9]*)5 9p read acme/$winid/body6 if not if(~ $text9term unix!*)7 dial -e $text9term </dev/null8 if not9 status=''10 }12 PROMPT='[^ ]*[%;$#][ ]+'14 fn cmds {15 text | 9 grep '^'$PROMPT'[^"]' | sed 's/^/ /'16 }18 switch($#*) {19 case 020 cmds | tail -121 case *22 cmds | 9 grep '^ '$PROMPT^$"* | {echo; cat} |23 pr -t -n | sort -nr | sort -u +1 | sort -n |24 9 sed 's/^ *[0-9]+ //' | grep .25 }27 # the silly {echo; cat} gets around pr printing "empty file" when28 # presented with no input.