remove prompt to avoid double-sending problems

This commit is contained in:
rsc 2006-10-12 02:28:31 +00:00
parent 8ce01b22ae
commit e87d96c291

4
bin/"
View file

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