Hello and welcome to the forum
I suspect it's because watch is running the command in a dash shell - overriding your #!/bin/bash shebang - from the watch manpage
Code:
NOTE
Note that command is given to "sh -c" which means that you may need to
use extra quoting to get the desired effect. You can disable this with
the -x or --exec option, which passes the command to exec(2) instead.
(in Ubuntu, /bin/sh is a symlink to /bin/dash by default). There doesn't seem to be an explicit option to tell it to use bash - if it's essential to make this work, you could always modify the symlink (I've done that myself, for things that really won't work otherwise - e.g. Makefiles that assume /bin/sh is a bash shell).
Bookmarks