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

Write a script to implement the following commands Tree of DOS similar to which command of UNIX


echo "Enter path Name :="
read path
name=`find  "$path"  -print0 | xargs -0`
for i in $name
do
 if [ -d $i ];then
  echo $i>file.txt
  count=`awk 'NF{print NF-1}' FS="/" file.txt`
  format="|__"
  temp=`expr $count + 1`
  i=`echo $i|cut -d "/" -f $temp`
  for (( j=0 ; $j < $count ; j=`expr $j + 1` ))
  do
   format="|    "$format
  done
  echo "$format$i"
 fi
done
Output: 

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

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