2 ms·
You can check if stdout is a tty: if it's not, you output raw text. GNU ls does this: by default it outputs in a multiple column layout, but when piped, it outp
by fratajcz 6y ago
You can check if stdout is a tty: if it's not, you output raw text. GNU ls does this: by default it outputs in a multiple column layout, but when piped, it outputs one file per line.