test if a filename exists with specified string (ksh)

I'm trying to do a simple if statement that tests if a filename exists with a user specified string.

So say I have these files:

Assigned_1day_after_due_chuong
Assigned_1day_after_due_gallen
Assigned_1day_after_due_heidenre

and i'm running a script and want to know if a file exists with "chuong" in the name. I tried this but it never evaluates to true

if [[ (-f *$actualRecipient) ]]; then
...
fi

the variable actualRecipient = chuong

anyone know the correct syntax for this?


if ls "*${actualrecipient}*" > /dev/null 2>&1 ; then 
....
fi     

For regular files:

set -- *"${actualrecipient}"*;[ -f "$1" ] && ...

Otherwise change the test.

The thing is that *$var could match mutliple items and perhaps only one of them is file. So a secure solution would be to loop through them all to see if *$var matches a file or not. If you are very sure that *$var will match 1 or 0 files then you could use the single bracket if statement:
if [ -f *$var ] ; then echo match found ; fi
But this will do various things if *$var matches 2 or more items.

Right,
mine fails if the first match is to a directory or pipe, for example.

May be something like this will be more suitable:

f_exists() {
	for f;do
		[ -f "$f" ] && return 0;
	done;
return 1
}

f_exists *"${actualrecipient}"*

echo $var | grep chuong >/dev/null

if [[ $? -eq "0" ]]
then
... statement
else
..... statement
fi

find <directory where files are> -type f -name \*chuong\* -exec <whatever you want to do with the file> {} \;

if it is complex what you want to do with this file you could use:

find <directory where files are> -type f -name \*chuong\* | \
while read FILE
do
<do whatever with the file which name is stored in the variable "FILE">
done