]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/"
Remove ap(1)
[plan9front.git] / rc / bin / "
1 #!/bin/rc
2
3 rfork en
4
5 PROMPT='[^      ]*(%|;)[        ]+'
6
7 fn cmds {
8         grep '^'$PROMPT'[^"]' /dev/text | sed 's/^/     /'
9 }
10
11 switch($#*) {
12 case 0
13         cmds | tail -1
14 case *
15         cmds | grep '^  '$PROMPT^$"* | {echo; cat} |
16                 pr -t -n | sort -nr | sort -u +1 | sort -n |
17                 sed 's/^ *[0-9]+        //' | grep .
18 }
19
20 # the silly {echo; cat} gets around pr printing "empty file" when
21 # presented with no input.
22