Input file check

Hi,

I have a script which runs daily. It gets 3 input files test1,test2,test3. I want to do a validation in my script to make sure i have all the 3 files available before running. If any one of the file is missing i want to break the script.

Could you please help me with this request.

Thanks,
Krish

if [ ! -f test1 -o ! -f test2 -o ! -f test3 ]
then
    echo file missing
    exit 1
fi
1 Like