Structure Query Language, C programming, Java, Servlet, Jsp, Unix
Home
Special
C / C++
GTU [PL/SQL]
IVAN BAYROSS [SQL]
JAVA
UNIX
WTAD
FON
Contact Us
CPP
Android
SEO
Wednesday, 22 February 2012
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
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment