Hey there,
Just FYI - it's good to put what you've tried in your post, so everyone doesn't think you're doing homework ;)
You can write this all on one line if you want - use expr to count the chars on each line of the file
#!/bin/sh
while read x
do
chars=`expr "$x" : '.*'`
if [ $chars -eq 4000 ]
then
echo "${x}foofoo" >>tmpfile
else
echo ${x} >>tmpfile
fi
done <inputfile
cp inputfile inputfile.bak
mv tmpfile inputfile
Hope that helps :)
, Mike