Hi guys,
Sorry about the really simple question, but I don't use UNIX much, I am writing a script that executes some other script code based on whether it finds some files or not. Here is what I came up with:
#!/bin/csh
FILE='XXX.YYY.*'
if find ./ -name $FILE ; then
echo "true"
else
echo "false"
fi
The problem is that in another sub-directory I have historical files with the same name structure with ".gz" I have to use the * wildcard and as such it picks up the ".gz" in the other subdirectory. Also, the names can not change.
Is there a way for me to tell the find command to not search recursively?
Thanks and my apologies for the simplicity of the question.
pepito609
Sorry about the really simple question, but I don't use UNIX much, I am writing a script that executes some other script code based on whether it finds some files or not. Here is what I came up with:
#!/bin/csh
FILE='XXX.YYY.*'
if find ./ -name $FILE ; then
echo "true"
else
echo "false"
fi
The problem is that in another sub-directory I have historical files with the same name structure with ".gz" I have to use the * wildcard and as such it picks up the ".gz" in the other subdirectory. Also, the names can not change.
Is there a way for me to tell the find command to not search recursively?
Thanks and my apologies for the simplicity of the question.
pepito609