I have one file contains several lines, each line has the format like
2011-07-10 condition hhh aaa: value bbb
2011-07-10 condition ccc aaa: value bbb
I want to use sed to find the value string, which is between “aaa:” and “bbb”, and replace to “gotit” based on the condition that the string following condition is ccc. and after sed, this file becomes
2011-07-10 condition hhh aaa: value bbb
2011-07-10 condition ccc aaa: gotit bbb
Given my limited knowledge of sed/regex: