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

Fetch the data from a file and display data into another file in reverse order


echo "Enter filename"
read filename
if [ ! -f $filename ];then
 echo "file not exist"
 exit 1
fi
str=`cat $filename`
len=`echo $str|wc -c`
i=$len
while [ $i -ge 1 ] 
do
 temp=$temp`echo $str|cut -c $i`
 i=`expr $i - 1` 
done
echo $temp>newfile.txt
cat newfile.txt

Output: 

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

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