from Hacker News

Bash one-liners useful for bioinformatics

by lysozyme on 9/22/24, 6:36 PM with 1 comments

  • by eesmith on 9/22/24, 7:35 PM

      Display hidden control characters:
    
      python -c "f = open('file.txt', 'r'); f.seek(0); file = f.readlines(); print file"
    
    That hasn't been updated for Python 3, and I really don't think it does anything reasonable. The 'r' is not needed, the seek is pointless, and the output will contain the Python representation of a list of strings.

    Use cat -v:

         -v      Display non-printing characters so they are visible.  ...
    
    Has Perl disappeared from general bioinformatics knowledge?