Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optivity Tip -- When change is good... [Optivity NMS - Unix]

Status
Not open for further replies.

jfk

Vendor
Mar 11, 1999
67
US
There's an easy way to make global changes to your database in Optivity... (you may have guessed from the last tip).<br>
<br>
Modify the plain text backup.<br>
<br>
For instance, instead of retopoligizing or making laborous individual changes to each device in a large network after making a network-wide community name change, you can simply edit the string in the backup file and restore it.<br>
<br>
Change done.<br>
<br>
Bonus tip:<br>
<br>
But I only have vi as an editor... Woe is me.<br>
<br>
You can still make global changes with vi as well. Take the previous example, we've changed all our read community strings from "public" to "twit". The syntax in vi for the global change would be:<br>
<br>
:g/public/s/public/twit/g :g/&lt;string to search for&gt;/&lt;action&gt;<br>
actions ==&gt; s/&lt;what to replace&gt;/&lt;replacement string&gt;/g<br>
(Substitute)<br>
(the "g" means change all ocurrences)<br>
d (Delete the line)
 
Lost a bit in the formatting... Here's another try!<br>
<br>
<br>
:g/public/s/public/twit/g __&lt;====Example<br>
<br>
:g/&lt;string to search for&gt;/&lt;action&gt; __&lt;===Syntax<br>
__________________________actions ==&gt; s/&lt;what to replace&gt;/&lt;replacement string&gt;/g<br>
________________________________________(Substitute)<br>
________________________________________(the "g" means change all ocurrences)<br>
________________________________________d (Delete the line)
 
Example of global delete [delete all lines with string]:<br>
<br>
:g/&lt;string to search for&gt;/d
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top