If statement

Hi,

I have this code here. Its suppose to do something when certain condition is met, I'm pretty sure at least one of the condition will be meet somewhere in the loop but it always go to else part of the script.

Is something wrong on this script?

age_list=`tar -tvf /home/dir/$tarfile | grep $some_variable | grep "$date"`
           if [ -f "$age_list" ]; then
                 echo "yes"
           else
                 echo "no"
           fi

Thanks!

Where is the $date variable set? I do not see it.

to get the $date, I use the read command.

The format for the date is "Mon dd". i.e. Jan 17

Set xtrace / verbose and debug your code to understand what is going on.

Sure that age_list will hold one single file that exists?