Take the 2-minute tour ×
echo $BASE_DIR
echo $PROC_NM
BASE_LOG_DIR=`find $BASE_DIR -filename "*$PROC_NM"`

returns me:

"./scripts/checkout_dcc.sh" 113L, 2642C written
bash-3.2$  ./scripts/checkout_dcc.sh 
find: invalid predicate `-filename'

I've tried multiple different quotes for this, but for some reason find doesn't like me using the variable for the search dir.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It says that -filename is not a valid predicate. You need -name, as specified in man find:

$ man find | grep -ce '-filename'
$ man find | grep -ce '-name'

Using a variable there will work as you expect:

find $BASE_DIR -name "*$PROC_NM"
share|improve this answer
add comment

Your Answer


