Hi Julian,
jhx writes:
> Hello everyone,
>
> I personally often use 'fold' to break up some long lines, which works
> well. Lately I have been in the need to cut of a line at a specific length -
> removing the rest of the line. I made a small patch for 'fold' to do just
> that. The line gets cut
FWIW, we can do that with sed.
Here's an example to crop at 50 chars (this example uses perl to generate
two lines of different lengths).
$ perl -le 'print "a" x 40; print "a" x 80' | sed -E 's/^(.{50}).+/\1.../'
aa
Hello everyone,
I personally often use 'fold' to break up some long lines, which works
well. Lately I have been in the need to cut of a line at a specific
length - removing the rest of the line. I made a small patch for 'fold'
to do just that. The line gets cut off at WIDTH (specified via -w W