for i in /lib/* /usr/lib/*; do if [ -d $1 ] then cd $1; for ii in *; do if [ -x $ii ] then echo $ii >> $ldd1; ldd $ii | grep "not found" >> $ldd1; fi; done elif [ -x $i ] then echo $i >> $ldd1; ldd $i | grep "not found" >> $ldd1 fi; done