3 ms·
I usually used tac | tac for a stupid way of pausing in a pipeline. Though it doesn’t work in this case. A typical use is if you want to watch the output of som
by dan-robertson 5y ago
I usually used tac | tac for a stupid way of pausing in a pipeline. Though it doesn’t work in this case. A typical use is if you want to watch the output of something slow-to-run changing but watch doesn’t work for some reason, eg:
while : ; do
( tput reset
run-slow-command ) | tac | tac
done
- caymanjim 5y agoThe easy way to do this is with 'tee /dev/tty' in the middle.
- deleted 5y ago[deleted]
- dan-robertson 5y agoI don’t understand why that would work? The goal is to buffer the output of the commands and then send it all at once.
- caymanjim 5y agoI misunderstood the goal.
- yjftsjthsd-h 5y agoHow is that different from | cat?
- efreak 5y ago`cat` will begin output immediately. `tac` buffers the entire input in order to reverse the line order before printing it. Piping through tac ensures EOF is reached, while piping through tac a second time puts the lines back in order