Sed instance memo requirement: Modify build config file under all automation script directories. Each feature contains at least one build config file, with the file name: build. cfg, build_6.9.cfg... you need to search for the Keyword: INCLUDE_PING or INCLUDE_PING6 in each build config file. if the keyword is found, you need to insert: INCLUDE_IPPING_CMD or INCLUDE_IPPING6_CMD. There may be four types of keywords: 1. but not the end: vip_components_t1 = "INCLUDE_PING \ in this case, you need to insert the target row to the line below the keyword line. Target effect: vip_components_t1 =" INCLUDE_PING \ INCLUDE_IPPING_CMD \ 2. middle, non-starting and non-ending: vip_components_t2 = "INCLUDE_SHELL \ INCLUDE_SHELL _ INTERP_CMD \ shortde_ping \ shortde_ping6 \ shortde_ipping6_cmd "in this case, you need to add the target row to the top or top of the keyword. Target effect: vip_components_t2 = "INCLUDE_SHELL \ INCLUDE_SHELL_INTERP_CMD \ INCLUDE_PING \ INCLUDE_IPPING_CMD \ INCLUDE_PING6 \ INCLUDE_IPPING6_CMD \ Terminal" 3. Vip_components_t2 = "INCLUDE_SHELL \ INCLUDE_SHELL_INTERP_CMD \ INCLUDE_PING" in this case, you need to add the target row to the previous line of the keyword row. Target effect: vip_components_t2 = "INCLUDE_SHELL \ INCLUDE_SHELL_INTERP_CMD \ INCLUDE_IPPING_CMD \ INCLUDE_PING" 4. vip_components_t2 = "INCLUDE_PING" is a little complicated. You need to insert the target row to the bottom of the keyword line, and replace the double quotation marks after the keyword with the backslash. Target effect: vip_components_t2 = "INCLUDE_PING \ INCLUDE_IPPING_CMD" solution: After the analysis, the actual situation 1 and 2 can be solved using a sed expression, and Case 3 requires another expression. Because case 4 is rare and a little complicated, sed is not used to solve the problem (keep thinking later). sed expression: find. -name "build *. cfg "| xargs sed-e '/INCLUDE_PING \> \ s * \/a \ INCLUDE_IPPING_CMD \'-E'/INCLUDE_PING6 \> \ s * \/\ INCLUDE_IPPING6_CMD \ '-E'/[^ \ "] \ s * INCLUDE_PING \> \ s * \"/I \ INCLUDE_IPPING_CMD \'-E'/[^ \ "] \ s * INCLUDE_PING6 \> \ s * \"/I \ INCLUDE_IPPING6_CMD \ '-I this expression solves situation 1, 2, 3. To solve the problem 4: find. -name "build *. cfg "| xargs grep-niHr \" INCLUDE_PING \ "Then manually modify the files based on the searched file names (stupid method ).