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:57] – 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 ====== | ||
| + | ===== Asigando vector bash a vector expect ===== | ||
| + | |||
| < | < | ||
| #/bin/bash | #/bin/bash | ||
informatica/linux/expect.1512511073.txt.gz · Last modified: by jose
