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 those files (in the given Directory) which are having multiple links.


clear
echo "Enter Directory Name :="
read dir
len=`ls -l $dir | wc -l`
i=2
echo "File With Multiple Link are : "
echo " "
while [ $i -le $len ]
do
 record=`ls -l $dir | head -n $i | tail -n 1`
 filename=`echo $record | cut -d " " -f 9`
 link=`echo $record | cut -d " " -f 2`
 if [ $link -gt 1 ];then
  echo "$filename = $link"
 fi
 i=`expr $i + 1`
done

Output: 

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

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