You are not logged in.
so, basically I need to do the following:
I have a file and I search for a specific line with certain characters:
grep "style = " file
that gives me a line that looks like this:
style = "foo"
I don't know what can be inside the quotes, I just need to replace whatever is inside the quotes for a new word.
style = "new_word"
I've been searching through various similar questions in stackoverflow and I feel like the best one I found was this:
sed -e 's/-s "[^"]*"/-s "new_word"/'
I've been playing with that one, making some modifications and piping the result of the first grep command into that sed command, but haven't had any look, can anyone help me ?
Offline
piping the result of the first grep command into that sed command
Everytime you do that, a fairy dies
sed 's/^style = "[^"]*"/style = "new word"/g'
You're not asking together some silly install script that you intend to deploy, are you?
Because I'm not so sure that your pattern is overly robust, blanks are typically compressed by the ini syntax and the "style" key can have different meanings depending on the "[group]" etcetc.
Offline