Hi the script works below if you run:
However it does not run if you use:
I think it's because posparam $1 does not know how to interpret
Or /* is intrpretted as $2?
Any ideas?
Thanks
Code:
# Check for symbol
# At least 1 posparam
if [[ $# != 1 ]]
then
echo "Usage: $0 <path>"
exit 190
fi
#Check if the string contains a *
set -x
#Write out to a file for ease
echo "$1" > /tmp/file.$$ 2>/tmp/file.0.$$
grep '*' /tmp/file.$$ >/tmp/file0.$$
if [[ "$?" -eq 1 ]]
then
echo "Required i.e. $1/*"
else
echo "Symbol is NOT required"
fi
# Remove the files
rm -f /tmp/file.$$ /tmp/file0.$$