I have a script which removes files (if they exist)
Here is a cut down example of the script.
Variables file1,file2 etc have already been initialized
#!/bin/bash
if [ -f $file1 ]
then
\rm file1
fi
if [ -f $file2 ]
then
\rm file2
fi
if [ -f $file3 ]
then
\rm file3
fi
if [ -f $file4 ]
then
\rm file4
fi
if [ -f $file5 ]
then
\rm file5
fi
if [ -f $file6 ]
then
\rm file6
fi
Because I read his first post which said he already had initialized the filenames elsewhere in his script, from his post I had no way of knowing if they were used for other things previous to being removed and thus though it better to use his preexsisting variables.