I can easily pipe the output of a command like:
some_command | less
I can also easily play a sound after a command like:
echo test; print \\a
aplay, beep or others could also be used for sound.
What I need is to do both, I mean, play the sound and pipe the output. Something like (it doesn't work)
(echo test; print \\a ) | less
Of course, if I do this, the sounds play after less quits, which is not what I want:
echo test | less ; print \\a
This code works:
echo test > /tmp/tmp.txt ; print \\a ; less /tmp/tmp.txt
However, I found it quite inelegant. There can be also annoying problems if executing more than one at the same time. They can be solved with a script, but it becomes unnecessarily complicated. Any better solution?