informatica:linux:expect
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
informatica:linux:expect [2017/12/05 21:58] – jose | informatica:linux:expect [2017/12/05 22:08] (current) – jose | ||
---|---|---|---|
Line 28: | Line 28: | ||
===== expect ===== | ===== expect ===== | ||
+ | ==== foreach ==== | ||
+ | |||
< | < | ||
#/bin/bash | #/bin/bash | ||
Line 47: | Line 49: | ||
como estamos | como estamos | ||
</ | </ | ||
+ | === Con índices === | ||
+ | < | ||
+ | /bin/bash | ||
+ | / | ||
+ | set vector {} | ||
+ | lappend vector "hola que tal" | ||
+ | lappend vector "como estamos" | ||
+ | |||
+ | for {set i 0} {\$i < [llength \$vector]} {incr i} { | ||
+ | puts [lindex \$vector \$i] | ||
+ | } | ||
+ | |||
+ | EOF | ||
+ | </ | ||
+ | Salida | ||
+ | < | ||
+ | hola que tal | ||
+ | como estamos | ||
+ | </ | ||
====== Recorrer un vector bash en expect ====== | ====== Recorrer un vector bash en expect ====== |
informatica/linux/expect.txt · Last modified: 2017/12/05 22:08 by jose