diff options
| author | stanley lieber <stanley.lieber@gmail.com> | 2011-11-21 10:39:34 -0600 |
|---|---|---|
| committer | stanley lieber <stanley.lieber@gmail.com> | 2011-11-21 10:39:34 -0600 |
| commit | 67fe83b40f4d427d3abc5f52bc1509559ec04214 (patch) | |
| tree | d7856da5612b934e0af93aaebbb754b41838242c /rc/bin/" | |
| parent | 51b39ae43c55df47a8b19c9d01c84be60eda9fa0 (diff) | |
| download | plan9front-67fe83b40f4d427d3abc5f52bc1509559ec04214.tar.xz | |
add rc scripts ", "" and g from rsc
Diffstat (limited to 'rc/bin/"')
| -rwxr-xr-x | rc/bin/" | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rc/bin/" b/rc/bin/" new file mode 100755 index 000000000..56bdaba77 --- /dev/null +++ b/rc/bin/" @@ -0,0 +1,25 @@ +#!/bin/rc + +rfork en + +if(test -r /mnt/acme/acme/body) + bind /mnt/acme/acme/body /dev/text + +PROMPT='[^ ]*%[ ]+' + +fn cmds { + grep '^'$PROMPT'[^"]' /dev/text | sed 's/^/ /' +} + +switch($#*) { +case 0 + cmds | tail -1 +case * + cmds | grep '^ '$PROMPT^$"* | {echo; cat} | + pr -t -n | sort -nr | sort -u +1 | sort -n | + sed 's/^ *[0-9]+ //' | grep . +} + +# the silly {echo; cat} gets around pr printing "empty file" when +# presented with no input. + |
