Menu

Strange characters outputting

Help
2010-11-18
2013-05-23
  • Sonny Gupta

    Sonny Gupta - 2010-11-18

    Hi,
    I was trying to print out the command list after SSH'ing and was sending this command:

    echo $PATH | awk '{split($1,my,":"); for(i in my) print my_ }' | xargs ls

    when I read the output, I'm getting a lot of strange characters where the tabbing should be:

    

    is this a character encoding issue? Have you encountered this before?

    Thanks for any help you can provide.
    Sonny_

     
  • Johan Walles

    Johan Walles - 2010-11-19

    Looks like an ANSI escape code, probably part of your prompt or colorized ls output:
    http://en.wikipedia.org/wiki/ANSI_escape_code#Sequence_elements

    From reading the wiki page it looks like text color is being set to cyan.

      Regards /J

     
  • Sonny Gupta

    Sonny Gupta - 2010-11-19

    Ah, that makes sense. Is there an easy way to remove these escape codes from a Java string?

     
  • Johan Walles

    Johan Walles - 2010-11-22

    If this really is ls coloring I'd disable them at the source.  Do "ls -color=none" on the remote system.

     

Log in to post a comment.

MongoDB Logo MongoDB