projects
/
pdt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4b26c43
)
improve expect so this works under at
author
Ian Kelling
<iank@fsf.org>
Wed, 25 Nov 2020 19:16:45 +0000
(14:16 -0500)
committer
Ian Kelling
<iank@fsf.org>
Wed, 25 Nov 2020 19:16:45 +0000
(14:16 -0500)
pdt.sh
patch
|
blob
|
blame
|
history
diff --git
a/pdt.sh
b/pdt.sh
index 21cb00fae96c60907bfe7c2bbf179a8e7669e958..237a4adb6aab3aeb1e4b2bdc7d7587c37084188f 100644
(file)
--- a/
pdt.sh
+++ b/
pdt.sh
@@
-23,15
+23,19
@@
rbow() {
f=$(mktemp)
cat >$f <<'EOF'
# adds a short delay after each send for more reliable operation
f=$(mktemp)
cat >$f <<'EOF'
# adds a short delay after each send for more reliable operation
-set force_conservative
0
+set force_conservative
1
spawn "rainbowstream"
# wait for prompt
expect -nocase timeout {exit 1} "@*]: "
set cmd [lindex $argv 0];
spawn "rainbowstream"
# wait for prompt
expect -nocase timeout {exit 1} "@*]: "
set cmd [lindex $argv 0];
-send "$cmd\r\rq\r"
+send "$cmd\r\r"
+expect -nocase timeout {exit 1} "@*]: "
+# this may not be needed. didnt test
+sleep 2
+send "q\r"
interact
EOF
interact
EOF
- expect $f "$*" || { deactivate; rm -f $f; return 1; }
+ expect $f "$*" || {
echo error: expect failed;
deactivate; rm -f $f; return 1; }
rm -f $f
else
rainbowstream
rm -f $f
else
rainbowstream