I tried running the command
watch -n1 ls foo/bar*
which I want to list files matching foo/bar*
every second. However, what actually happens is that the shell expands the glob and what watch
runs is, say,
ls foo/bar1.txt foo/bar2.txt
Thus, if another file foo/bar3.txt
is added later it won't show up in the output. Is there a neat way to do this without creating a script file containing
ls foo/bar*