Blob


1 #!/usr/local/plan9/bin/rc
3 . 9.rc
5 fn text {
6 if(~ $winid [0-9]*)
7 9p read acme/$winid/body
8 if not if(~ $text9term unix!*)
9 dial -e $text9term </dev/null
10 if not
11 status=''
12 }
14 PROMPT='[^ ]*[%;$#][ ]+'
16 fn cmds {
17 text | sed -n 's/^'$PROMPT'([^"])/ \1/p'
18 }
20 switch($#*) {
21 case 0
22 cmds | tail -1
23 case *
24 cmds | grep -n '^ '^$"* | tail -r |
25 sort -u +1 | sort -n |
26 sed 's/^[0-9]+: //'
27 }