I use watch to monitor the progress of file conversions.
watch -n 2 "echo Converted: $(ls *.mp3 | wc -l) of $(ls *.wav | wc -l) files"
When using command substitutions using the $(command)
syntax the values don't get updated each time watch reruns the command within the double quotes. How to do this properly? Since this is a simple script with all kinds of "progress" monitors I'd like to keep the watch
command and avoid something like pv.
$(...)
is called a command substitution, btw.) – ilkkachu Aug 19 '21 at 20:37