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

Write a script to find the global complete path for any file


clear
echo "Enter file name : "
read filename
str=`find . -name $filename`
if [ "$str" == "" ];then
    echo "File not found"
    exit 1
fi
path=`pwd`
len=`echo $str | wc -c`
str=`echo $str | cut -d "." -f 2-3`
echo "Full path of file is $path$str"


Output: 

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

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