On my FreeBSD 10.2 and 10.3 systems, when I am using
the output depends on the terminal size. This seems seriously weird for me.
Isn't a pipe supposed to make command's output behave in a predictable way?
For example
does all fancy formatting magic when run on its own, but when run like
it always returns the same output styling.
But unlike
, the output from
cuts the lines to terminal width on FreeBSD (on bash at least). From my brief experimenting, the same command always outputs full length lines in Linux when used with pipes.
Why is this happening and how can I fix it?
Is this just a really weird FreeBSD default? From my understanding this "feature" would make it almost impossible to write reliable bash scripts on FreeBSD as the output of simple piped commands would not be reliable. Isn't this a problem?
Also, I've tried it with
and the lines inside the file are cut exactly like how it was with grep and less!
Info: FreeBSD 10.2, bash 4.3.42. Same with connecting over SSH or when from KVM local console.
Code:
ps aux | grep ...
Isn't a pipe supposed to make command's output behave in a predictable way?
For example
Code:
ls
Code:
ls | less
But unlike
Code:
ls
Code:
ps aux | less
Why is this happening and how can I fix it?
Is this just a really weird FreeBSD default? From my understanding this "feature" would make it almost impossible to write reliable bash scripts on FreeBSD as the output of simple piped commands would not be reliable. Isn't this a problem?
Also, I've tried it with
Code:
ps aux > somefile
Info: FreeBSD 10.2, bash 4.3.42. Same with connecting over SSH or when from KVM local console.