This command with a * in the find path works fine on the local server
Svr1$ find /path/*/foo/ -name "*20160208"
When I try this remotely from another server it doesn't work
Svr2$ echo $Pswd|ssh Svr1 /usr/local/bin/sudo -S find /path/*/foo/ -name "*20160208*"
The error message is:
find: stat() error /path/*/foo/: No such file or directory
However, if I change the search path to avoid using the * it works fine. Like this:
Svr2$ echo $Pswd|ssh Svr1 /usr/local/bin/sudo -S find /path/ -name "*20160208*"
What am I doing wrong? I think I need to quote or escape part of the string but I just cannot figure it out.