[H-GEN] Text Search and Replace @ shell prompt

Greg Black gjb at gbch.net
Sun Aug 25 18:21:15 EDT 2002


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

| I've been given html files which were created in Windows and of course, they includes mixtures of lower and upper case for folder names.
| 
| But when on UNIX/Linux server, all those folders didn't come up coz html is looking for upper/lower case folder name within the file. Some files work if they match the name of the folder name. If one or two files, I would have gone through patiently in "vi" and change them but I have over 1000+ files. :-(
| 
| What I want is, is there a shell prompt command that I can give search pattern and replace them within the given entire folder? I heard that "awk" would do but I'm not up to that yet.

First, please don't use such long lines -- 70 characters is
plenty long enough.  Second, please don't send messages in
multipart/alternative -- plain text is the thing to use.

As for the question, yes there are many tools that will do what
you want.

If you describe the actual task a little more clearly, somebody
will probably give you a simple solution using ed or one of the
heavyweight tools like Perl.

Greg

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list