I would used sed.  You will have to learn a little bit about regular
expressions, but they are such a powerful tool that it is worth investing a
some time.

Basically:
cat oldscriptname| sed s/jabberd/newservername/g > newscriptname

----------------
Warren Melnick
Director of Research and Development
Astata Corporation




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 10:42 AM
To: [EMAIL PROTECTED]
Subject: Best tool 4 script string replacement


I am trying to write a script to modify a configuration script for 
the jabber server. I am new to shell scripting and was wondering how 
people would approach the following situations.

1. The host name is configured by the following xml tags

<host><jabberd:cmdline flag="h">localhost</jabberd:cmdline></host>
<update><jabberd:cmdline flag="h">localhost</jabberd:cmdline></update>

What is the best tool for replacing localhost or whatever is between 
the two tags with the contents of the variable $server_name.

2. Similar to the above the server modules are configured using tags 
similar to the following:

<mod_version>./jsm/jsm.so</mod_version>

I need to be able to comment this out using HTML style comments or 
remove the comments depending on what the user requests.

I have another issue that will need addressed later, but for now I am 
looking for advice on tools, useage of the tools and reading material 
to assist me in better understanding how to accomplish this.

Thanks,
Chad


--
Is your email secure? http://www.pop3now.com
(c) 1998-2001 secureFront Technologies, Inc. All rights reserved.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to