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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -