Directory Location: /var/lib/messageFunction-7834bdfjsdfj783/data/snapshot
I have the above directory and I need to find if the directory exists using a bash script.
#!/bin/bash
if [ ! -d "/var/lib/messageFunction-*/data/snapshot" ]; then
echo NO FOLDER
else
echo FOLDER IS THERE
fi
The above script always returned "NO FOLDER" but the directory exists in the location. Can you guide how to regex to identify the subdirectory?
Thanks