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.

3
  • 1
    Thanks for that thorough explanation! I really admire those who understand all that redirection-subshell-stuff and know their syntax... I tried your last example and it seems to work better than sed due to the large amount of characters in such a "line".
    – sjngm
    Commented Sep 14, 2016 at 7:17
  • I think I have to come back on this. I went with your last example and I learned that this somehow buffers the output and writes it all in one step to Outfile at the end of the program. Is there a way to enforce writing after each \n found? As in "write each line as soon as you have it" to Outfile?
    – sjngm
    Commented Sep 23, 2016 at 19:21
  • 1
    Sometimes, it is tricky to figure out where the troublesome buffer is. For starters, try: awk -F'\r' '{print $NF; fflush()}' >outfile
    – John1024
    Commented Sep 23, 2016 at 19:34