Hacker News new | past | comments | ask | show | jobs | submit login

That could be, but the change in wrapping behaviour makes me think it's journalctl doing it. If less acts like cat when the output is a pipe, then it wouldn't be wrapping at 80 columns, so journalctl must be doing the wrapping in that scenario.



yum does the same thing. I actually looked at the code and it always assumes the output width is 80 characters and wraps or center…truncates if output isn't a terminal. It also doesn't properly sort its output, so you're tempted to use `yum search | sort`, which ends up with indented lines at the top of the output.

Of course, the recommended thing to do is use a different program for scripts/pipelines rather than yum, so now there are two different interfaces that need to be remembered. yum looks like a terminal-friendly program, but actually isn't.

https://bugzilla.redhat.com/show_bug.cgi?id=584525

https://bugzilla.redhat.com/show_bug.cgi?id=986740


    journalctl | cat
...would cause less to act like cat and cat to, well, :-), and then the tty driver usually wraps from the last column to the first.


Sorry, when I said "wrap" I should have said "truncate".

journalctl truncates at the width of my terminal or at 80 columns if the output is not to a terminal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: