echo "enter a file name"
read f
n=`wc -l $f | cut -d " " -f 1`
i=1
while [ $i -le $n ]
do
line=`sed -n "$i p" $f`
cc=`echo $line | wc -c | cut -d " " -f 1`
echo "$cc"
while [ $cc -ge 40 ]
do
ext=`echo $line | cut -c 41-`
line=`echo $line | cut -c 1-40`
echo "$line \\"
line=$ext
cc=`echo $ext | wc -c | cut -d " " -f 1`
done
echo "$line"
i=`expr $i + 1`
done
read f
n=`wc -l $f | cut -d " " -f 1`
i=1
while [ $i -le $n ]
do
line=`sed -n "$i p" $f`
cc=`echo $line | wc -c | cut -d " " -f 1`
echo "$cc"
while [ $cc -ge 40 ]
do
ext=`echo $line | cut -c 41-`
line=`echo $line | cut -c 1-40`
echo "$line \\"
line=$ext
cc=`echo $ext | wc -c | cut -d " " -f 1`
done
echo "$line"
i=`expr $i + 1`
done
No comments:
Post a Comment