Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 5
    Note. tr doesn't handle characters which use more than one byte.. see Wikipedia tr (Unix) .. ie. tr is not Unicode compliant. Commented Aug 15, 2011 at 19:43
  • 3
    You're running 4 commands for every line of the file Commented Mar 3, 2015 at 18:25
  • 1
    you need to remove whitespace characters from $IFS, otherwise read will trim them from the start and end. Commented Mar 3, 2015 at 18:25
  • 1
    you can't use echo for arbitrary data Commented Mar 3, 2015 at 18:27
  • 1
    @Peter.O, some tr implementations support multibyte characters, but wc -c counts bytes, not characters anyway (need wc -m for characters). Commented Mar 3, 2015 at 18:28