Use sed with ignore case while adding text before some pattern

后端 未结 6 1241
名媛妹妹
名媛妹妹 2020-12-06 17:26
sed -i \'/first/i This line to be added\' 

In this case,how to ignore case while searching for pattern =first

6条回答
  •  情歌与酒
    2020-12-06 17:57

    Use the following, \b for word boundary

    sed 's/\bfirst\b/This line to be added/Ig' file
    

提交回复
热议问题