changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/"

changeset 7243: 34f64dcbbc25
parent: d24730b448d9
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
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