tremove prompt to avoid double-sending problems - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit e87d96c291c35ebc302ee4627867bdc1b6acd058
parent 8ce01b22aea99a47326a3f9e3e774ce90cdbb193
Author: rsc 
Date:   Thu, 12 Oct 2006 02:28:31 +0000

remove prompt to avoid double-sending problems

Diffstat:
  M bin/"                               |       4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/bin/" b/bin/"
t@@ -14,14 +14,14 @@ fn text {
 PROMPT='[^         ]*[%;$#][         ]+'
 
 fn cmds {
-        text | grep '^'$PROMPT'[^"]' | sed 's/^/        /'
+        text | sed -n 's/^'$PROMPT'([^"])/        \1/p'
 }
 
 switch($#*) {
 case 0
         cmds | tail -1
 case *
-        cmds | grep '^        '$PROMPT^$"* | {echo; cat} |
+        cmds | grep '^        '^$"* | {echo; cat} |
                 pr -t -n | sort -nr | sort -u +1 | sort -n |
                 sed 's/^ *[0-9]+        //' | grep .
 }