unix - Remove "...[C[0k" from expect output -


how can not generate substring "...[c[c[c[0k" after issued comands trough expect scripts? example, have following lines in expect script:

#set variables, parameters etc ... spawn telnet $ip $port expect -nocase "name:" send -- "$user\r" expect -nocase "password:" send -- "$pass\r" expect -re "$prompt" send -- "terminal length 0\r" expect -re "$prompt" send -- "show vlan\r" expect -re "$prompt" send -- "logout\r" expect eof 

after execution receive undesirable substrings:

username:[c[c[c[c[c[c[c[c[c[0kadmin password:[c[c[c[c[c[c[c[c[c[0k************** switch# [c[c[c[c[c[c[c[c[c[0kterminal length 0 switch#[c[c[c[c[c[c[c[c[c[0kshow vlan ... #'show vlan' command result here ... switch#[c[c[c[c[c[c[c[c[c[0klogout connection closed foreign host. 

does have tip on how can not generate these "[c[c[c[c[c[c[c[c[c[0k" strings? other issue i cannot use other tool(sed, awk, tr etc) remove strings, need expect not generate @ first place.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -