Tuesday, 15 July 2014

embedded - How to create sh script with expect? -


I am trying to create a script using the script for embedded system (not to include the firmware I want to change this script) So, I have the following script, which is the wrong use of val in if -black:

  The reason does not work! / Usr / bin / env Expected set timeout 20 set ipaddr [lindex $ argv 0] spawn telnet $ ipaddr is expected "soc1 login:" "root \ n" send "prompt" send "val =` some_command` \ n "" Prompt # "Send" if [\ $] Well-Ace 0]; Then Echo Good; fi \ n "# here ^^^^^" Prompt # Enter "Send" \ n "Interact  

I have tried to use $$ and this does not help. How to fix this script to allow the use of variables in Sh script?

[ and ] - These brackets should be saved:

  send "if \ [\ $ val -q 0 \]; then good resonance; FI \ n" # ^ ^^^^^ here " > 

No comments:

Post a Comment