> I want a script that will read the file and look for the name 
> "fred", and if it's found, leave the file alone, but if it's 
> not found, to add the name "fred" to the bottom of the file.

No need for awk/sed. Something like this should work.

#!/bin/bash
i=`grep fred FILENAME.TXT | wc -l`
if [ $i == "0" ]
then
        echo "fred" >> FILENAME.TXT
fi

> 
> Any help appreciated. Thanks!
> 
> -- 
> Kent West        <")))><
> http://kentwest.blogspot.com
> 
> 
> 
> --
> To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact 
> listmas...@lists.debian.org
> Archive: http://lists.debian.org/4bbce69d.3040...@acu.edu
> 
> 


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/fffa2cacdb4d5c44a24b093011381218011d9...@ersbs2.eyereturn.local

Reply via email to