i have this basic line of code that accepts for an input parameter. Example of input string is "/u02/app/ccalloc/dev/out/*.txt", a directory name with a wild card filename. my code below can get the directory name by using the `dirname $p1` command. when i attempted to use the `basename $p1` to get the filename with wild card character it failed.
$ sh sample.sh "/u02/app/ccalloc/dev/out/*.txt"
Usage: basename String [Suffix]
the directory is /u02/app/ccalloc/dev/out
the file string is
$
below is the code
#!/bin/sh
p1=$1
pdir=`dirname $p1`
pfile=`basename $p1`
echo "the directory is $pdir\n"
echo "the file string is $pfile\n"