1
edit
Changes
→Tips
* to check if a file exists: (when using wild cards, if you don't use double quotes, there will be this error: "binary operator expected")
<source lang=bash>
if [ -f "*m.patch" ]; then
rm *.patch
fi
</source>
* To check if multiple files exist:
<source lang=bash>
files=$(ls /tmp/*.cache)
if [ $files ]
then
echo "Cache files exist: do something with them"
else
echo "No cache files..."
fi
</source>