i was attempting to extract a directory path that was passed from a parameter with this code
vdir=`dirname $p1`
echo current directory $vdir
it does not work when the parameter passed has wild card on it.
for example
$ sh sample1.sh "/sbin/log/c*.log"
dirname: extra operand `/sbin/log/c1.log'
Try `dirname --help' for more information.
current directory
$
it works when not using a wild card (expanded file)
$ sh sample1.sh "/sbin/log/c1.log"
current directory /sbin/log
$
please help thank you.