postheadericon Write a script to display the name of all executable files in the given directory.



clear
echo "Enter Directory Name : "
read dir

ls $dir>fileList.txt
count=0

if [ -d $dir ]
then
     for fileName in `cat fileList.txt`
     do
        if [ -x $dir/$fileName ]
        then
           echo "$fileName"
           count=`expr $count + 1`
        fi
     done
fi
echo "Total Executable Files : $count"
rm fileList.txt

0 comments:

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.