ps output line length change
Jamie Landeg-Jones
jamie at catflap.org
Sat Feb 17 06:56:27 UTC 2018
Cy Schubert <Cy.Schubert at cschubert.com> wrote:
> That's a tough one. Break Linux compatibility or break BSD
> compatibility?
>
> Generally Linux users use ps -ef which we don't support and columns are
> different so, Linux compatibility is... well just isn't.
>
> My vote is to revert and have an environment variable with defaults,
> e.g., PS=--linux or something similar.
I agree entirely. This change effectively changes the output data simply due to
presence of a pipe.
So, the output of "ps" could be somewhat different to "ps | cat".. (*)
It's a total break of POLA.
It's unnecessary (-ww already exists to achieve it)
And I think it will actually make scripts more unreliable going forward... Which version
of "ps" are we running? Do we "-ww" or not?
Surely we want to remove ambiguity not add it.
I know it's a weird one - I remember long long ago getting bitten by scripts that
parsed "ps" getting seemingly unexplained truncation. But that's when I learnt how
"ps" works, and that's when I learnt of "-ww"
Now, if "ps" had never defaulted to tty-width truncation, then that would be fine,
but changing how it determines to do so now would be awful, in my opinion.
(*) I realise that piped output is often changed to remove control/colour attributes,
and "ls" switches off column mode, but the former is a different situation, and the
latter? Well, something we have to live with now, and it doesn't really affect the
actual raw data that's displayed.
Cheers, Jamie
More information about the freebsd-arch
mailing list