Tuesday, July 19, 2011

find:bad option find: path-list predicate-list error

This error happens when the wildcard character in your find command expands.
This mainly happens when you run inside a script rather than from a command prompt.
For example inside the perl program you have something like:

@files=`find . -name *C* `;

When you run this program it will through this error:
find:bad option
find:path-list predicate list

Solution to it is enclose the wildcards within single quote or double quotes like this
to prevent the error:

@files=`find . -name '*'C'*' `;
@files=`find . -name "*C*"`;

No comments:

Post a Comment