Mac nl only takes lines 2048 chars long

command lineterminal

I'm having an issue where the Mac version of nl will mark a new line after 2048 characters. I tried it on Linux, and it doesn't do this. Any idea why it does on Mac, and how to fix it?

Best Answer

From man nl:

BUGS
     Input lines are limited to LINE_MAX (2048) bytes in length.

To fix, you can either patch the source yourself (might need some work) or get the source for the Linux version (which is probably available on any GNU server).