F20 System Wide Change: No Default Syslog

Chris Adams linux at cmadams.net
Tue Jul 16 20:06:02 UTC 2013


Once upon a time, John.Florian at dart.biz <John.Florian at dart.biz> said:
> While I'm no more important than the next guy, I'll defend the auto-pager 
> feature of both git and journalctl.  I love it, in fact.  I'm no stranger 
> to very long pipelines and sub-shells but I see nothing but benefit in not 
> having to add "| less" routinely to things that are UI in nature.

My primary objection is that I don't like things that have differing
behavior between a TTY and a pipe.  One problem is if you are writing a
script to process output from something, you'll probably run the command
in a TTY to check the output, but you'll get different results.

There are not many programs that have such TTY/pipe behavior.  The only
ones that come to mind are "ps" (where output is truncated at screen
width) and "ls" (where "--color=tty" changes between TTY and pipe).  The
ls behavior makes sense (and doesn't change the information displayed,
formatting, etc.); the "ps" behavior is annoying.  I guess "man" has
similar auto-pager behavior to systemctl/journalctl (although IMHO man
is a different type of thing, since it is a documentation reader).

We already have pipes, and anyone that knows how to use a Unix shell
knows how to use them.  IMHO it is extra complication (and code
duplication) for programs to change behavior between a TTY and a pipe,
unless there are specific things that can't easily be accomplished with
a simple pipe (such as "ls --color=tty").  Pagination, truncation, etc.
are easy using pipes, and should not be done in regular programs.

-- 
Chris Adams <linux at cmadams.net>


More information about the devel mailing list