Subscribe to Get Free Material Updates!
Visit my new blog WebData Scraping - Web Scraping Service provider company in India.

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


clear
echo "Enter Directory Name:"
read dir
ls $dir>tempfile.txt
count=0
if [ -d $dir ];then
 for filename in `cat tempfile.txt`
 do
  if [ -x $filename ];then
   echo "$filename"
   count=`expr $count + 1`
  fi
 done
fi
echo "Total Executable Files Are $count"
rm tempfile.txt

Output: 

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes