I'm trying to add a string (e.g. 'TEST END') to the end of each line in a file with say 20 rows but am not having much success as the string ony gets added to the first line. Anyone have any idea as to how to accomplish this? I'd very much appreciate it.
here is a small script that i created i hope that this is what you want.
########################################
#!/bin/sh
COUNT=0
cat 111.txt |while read den
do
echo ${den} >> /tmp/101.txt
COUNT=`expr ${COUNT} + 1`
if test ${COUNT} -ge 20
then
echo "Strings you want to APPEND at LINE 20.... " >> /tmp/101.txt
COUNT=0
fi
done
######################################
good luck...
Thanks, this does do the job though it looks as if the formatting has changed but I'll figure it out. It's so simple and obvious I'm embarrassed but sometimes that's just how it goes.... thanks man!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.