I want to execute a particular block of code if given file exists.
if ssh user@$host "test -e $file";
...
When $file
is a complete file name such /tmp/test1.txt
this works fine. However, if I want to check if any file exists in a directory such as $file
is /tmp/*
, I get
bash: test: too many arguments
Is it possible to use *
with test -e
, if yes how?