Hi I tried using sed and following are the problems I faced:
1. sed operates on a file, I have to take value from a variable.
2. actually I need to replace '/' by '\/'. Here is some more detail if I am following the wrong track:
actually I have written a script that works on a file having attribute,value pairs in the format :
attribute= value
i have to search for an attribute and update it's value, iff the attribute and the file requested are found.
Now there are certain attributes which have paths, eg : source= /usr/java14/bin
If the user wants to update this value, according to the current script he needs to be intelligent enough to write the new value as \/usr\/bin, for example... i.e the user himself escapes all the '/'.
But i want to make it easy for the user, I hope I have explained my problem.
So how shall I approach?
(Pls avoid giving solutions directly and only hint, I want to trouble my brain)