check for FILES existence

hi, I have a list of filenames and I want to verify if they all exist. I know "if filename" would do the trick but how do I go about a list of files? thanks

Try this

for i in `ls -1`
do
if [ -s $i ]
then
echo "file exist"
fi
done

You can avoid using the ls command here. Also, mbketan, using '-f' is perhaps better that using '-s' in this case, as the OP may also want to test for empty (zero byte) files.

#!/usr/bin/ksh
for file in *; do
[[ -f $file ]] && echo $file is a regular file
done

Wait a minute, it seems that the OP wants to test for a list of filenames that (s)he already has. In that case, do this:

#!/usr/bin/ksh
for file in $@; do
[[ -f $file ]] && echo $file exists
done

so I guess I have to do it with a for loop, anyway, thanks for your input!