I created a sample .sh file with script like this:
if [ -f "/Spool/Cognos/Cognos.xlsx" ]
then
echo "File exists"
else
echo "File not exists"
fi
However, I would like to change so that it could read file with dynamic names, the files that will be uploaded in the folder /Spool/Cognos will be something like this:
Cognos Aug24.xlsx,
Cognos Sep24.xlsx,
Cognos July24.xlsx, etc.
How can I change the if part of the script above? I tried
if [ -f "/Spool/Cognos/Cognos*.xlsx" ]
with * as wildcard but it seems like it does not work.
1