It comes down to being able to save the dynamic output
(I'll explain) of terminal into a text file, but here's what I'm ultimately seeking.
I created a custom command for terminal called playRandom
, what it does is that it plays random songs forever. The bash file I created for this:
#!/bin/bash
find ./ -type f | sort -R | xargs -I + play +
Note: The play
command is from SoX software.
Now the output looks something like this:
As you can see the output changes dynamically
, so I cannot use >>
to save the output.
I want to be able to save 'names of songs that are played' into a text file.
How can I achieve this goal? Thanks in advance.