sed append word at end of line if word is missing
I have to modify formsweb.cfg file in Oracle IAS.
In formsweb.cfg file are two lines with labels archive_jini= and archive= at the beginning of line. After equal sign (=) is row of filenames of java archives delimited by coma(,). When I insert a new jar file in java directory, I have to append the very same name of jar file to both lines if that name is not yet present.
I would appreciate some (a lot!!!) help.
example snippet from formsweb.cfg
# Forms applet parameter
# Forms applet archive setting for JInitiator
# Forms applet archive setting for other clients (Sun Java Plugin, Appletviewer, etc)
# Number of times client should retry if a network failure occurs. You should
# only change this after reading the documentation.
I think this should do it, assuming the sample is representitive of the whole. It works for me in testing:
The -i option edits the file in place, with .backup creating a backup of the original.
And I was brain shaking :banghead: in my head for two days!
This is exactly what I was looking for tonight... David the H., you're the man... :)
|All times are GMT -5. The time now is 08:02 AM.|