in reply to odd escape chars in strings obtained by SSH

Those are terminal colour codes from some version of ls. Try setting the terminal type on the other end to DUMB or run ls --color=never to tell it not to output color escapes.

  • Comment on Re: odd escape chars in strings obtained by SSH

Replies are listed 'Best First'.
Re^2: odd escape chars in strings obtained by SSH
by dah (Sexton) on Oct 11, 2007 at 16:51 UTC
    Or ask ssh not to allocate a tty (terminal).
Re^2: odd escape chars in strings obtained by SSH
by lykich (Initiate) on Jun 25, 2021 at 18:27 UTC
    It is true, have strings from expect and can not clear from different symbols. It working $ssh->send("ls --color=never -A1"); Thanks.