From: FINK,RICH (HP-USA,ex1) (rich.fink@hp.com)
Date: Tue Apr 15 2003 - 10:41:26 EDT
Hello Admins,
Many thanks to all those who responded to my foggy-brained request,
especially Bill Thompson, Richard Goodwin, and Stuart Abramson. In the end,
the easiest solution was a combination of the responses. Tested it, ran it
on production, and it worked perfectly.
Thanks again for the quick and enlightening responses!
-Rich
----------------------< This is what I used
>-----------------------------------
#! /bin/sh
set -x
cd <directory_containing_config_files>
for f in *.conf
do
if grep -i '#to_addr=Maureen
Schultz/Unix(maureen_schultz@ibs.com)' $f
then
/bin/vi $f >/dev/null <<END
:set ignorecase
/#to_addr=Maureen Schultz\\/Unix(maureen_schultz@ibs.com)
0C#to_addr=Maureen Carroll/Unix(maureen_carroll@ibs.com)^[:w!
:q!
END
fi
done
-------------------------< Original Question below
>--------------------------
Hey Admins,
Ok, I just got off a 4 1/2 hour conference call, and will admit I'm
a little brain dead at the moment. I looked in the archives, but couldn't
find what I was looking for..
Anyway, I have to edit a large number of files, making a similar
change to each one. Basically they're application configuration files,
containing a list of email names and addresses, along with other data. We
had a user change her name, which now necessitates changing her email in
these conf files.
So I have about 100 files, in a directory of ~250, with a line like:
#to_addr=Maureen Schultz/Unix(maureen_schultz@ibs.com)
which needs to be changed to:
#to_addr=Maureen Carroll/Unix(maureen_carroll@ibs.com)
I'm assuming the easiest way would be a sed/awk script, but of
course my book is at home. (isn't that always the way?) The sed man page
helps, but it also appears to be case-sensitive. Naturally, my files have
mixed case.
Any help or pointers would be greatly appreciated, and I'll
summarize. Thanks!
-Rich
Rich Fink 404-(t)648-8191
rich.fink@hp.com
Team Lead
Americas HPS IT Front End Systems
Order and Contract Administration Systems
-- ---> Please post QUESTIONS and SUMMARIES only!! <--- To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only) http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)
This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:28 EDT