News for hackers. Stuff that matters.
Re:Things you (probably) didn't know about xargs by premchai21 on Sunday June 26, 2011 @05:54PM (#2699211)
Would not « print0() { tr '\n' '\0'; } » work in most cases? Does your utility do something special to existing instances of \0? That's the only case I can imagine where the transformation is necessarily lossy and it's not clear what to do. I suppose in theory you could have newline normalization or something too.
Re:Things you (probably) didn't know about xargs by barrkel on Sunday June 26, 2011 @06:45PM (#2699347)
No, because that doesn't handle command-line arguments or '-' in the same way that cat does. It also doesn't handle the differences between DOS, Unix and Mac (\r, \n and \r\n) line endings properly. Finally, it's also slower than my 80-line C version.