Cd error terminating loop

Hi All,

I am trying to make a small shell script.In this it will got directory as per variable & run the find command on that directory.There are 120 + directories & not sure all of them are mounted.So the issue is if the directory doesent exists my loops gets terminated. so is there any was that it just show me the error & continue looping.
All the directories are on root FS.I have specified all the directires in a file /tmp/filer1

##########################

while read inputline
do
   cd $inputline
#pwd
    find . -size 0 -type l -exec ls -l {} \;>>/mot/systems/filer_bug/$inputline&
done</tmp/filer1

############################
Output
############################

maruti# cd /fil01vol18_ata
/fil01vol18_ata: No such file or directory
maruti# pwd

##############################

Best Regards

Ankit

 
while read inputline
do
if [ -d $inputline ]
then
        cd $inputline
         #pwd
        find . -size 0 -type l -exec ls -l {} \;>>/mot/systems/filer_bug/$inputline&
else
          echo "$inputline not found"
fi
done</tmp/filer1

Thanks Kamraj

Regards

Ankit

Hi

replace this line...
cd $inputline ------>>> cd $inputline 2> /dev/null

its too easy and lite

Atul