Any idea why this command isn't working?
dd if=/dev/zero of=/dev/null status=progress |& tr '\r' '\n' >> test.txt
I want the contents of test.txt to look something like this.
395191296 bytes (395 MB, 377 MiB) copied, 1 s, 395 MB/s
805187584 bytes (805 MB, 768 MiB) copied, 2 s, 403 MB/s
1239563264 bytes (1.2 GB, 1.2 GiB) copied, 3 s, 413 MB/s
1666015232 bytes (1.7 GB, 1.6 GiB) copied, 4 s, 417 MB/s
Right now the command is printing nothing to test.txt
It's all because of tr
wait for its job finish, which will take an infinite time.
unbuffer
can help you in this situation:
dd if=/dev/zero of=/dev/null status=progress |& unbuffer -p tr '\r' '\n' >>test.txt