I'm trying to follow this answer but I can't make it work.
I simplified it down as much as I could to try work out what's going on (just running this at the terminal for now):
rsync --progress -iav /my/dir1 /my/dir2 | awk '{ print($0) }'
But it only prints messages likersync: failed to set times on [file].
What am I doing wrong?
Edit: On further investigation it seems like awk is doing some sort of buffering. This:
for i in 10 20 30; do echo $i; sleep 1; done | awk '{print $0}'
Demonstrates a problem where no output is seen until 3 seconds have passed.
So I guess the question is how do I get awk to flush its buffer? I tried:
for i in 10 20 30; do echo $i; sleep 1; done | awk '{print($0); fflush()}'
Which had the same problem.