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