1 2b85f70d 2005-01-11 devnull #!/usr/local/plan9/bin/rc
4 47e0a2aa 2004-10-17 devnull if(~ $winid [0-9]*)
5 47e0a2aa 2004-10-17 devnull 9p read acme/$winid/body
6 47e0a2aa 2004-10-17 devnull if not if(~ $text9term unix!*)
7 47e0a2aa 2004-10-17 devnull dial -e $text9term </dev/null
12 47e0a2aa 2004-10-17 devnull PROMPT='[^ ]*[%;$#][ ]+'
14 47e0a2aa 2004-10-17 devnull fn cmds {
15 2b85f70d 2005-01-11 devnull text | 9 grep '^'$PROMPT'[^"]' | sed 's/^/ /'
18 47e0a2aa 2004-10-17 devnull switch($#*) {
20 47e0a2aa 2004-10-17 devnull cmds | tail -1
22 2b85f70d 2005-01-11 devnull cmds | 9 grep '^ '$PROMPT^$"* | {echo; cat} |
23 47e0a2aa 2004-10-17 devnull pr -t -n | sort -nr | sort -u +1 | sort -n |
24 2b85f70d 2005-01-11 devnull 9 sed 's/^ *[0-9]+ //' | grep .
27 47e0a2aa 2004-10-17 devnull # the silly {echo; cat} gets around pr printing "empty file" when
28 47e0a2aa 2004-10-17 devnull # presented with no input.