Remove specific words from sentences in bash?
问题 I want to remove negative words form sentence using bash script . The negative words that i meant it : [dull,boring,annoying,bad] My file text text.txt contains this sentence : These dull boring cards are part of a chaotic board game ,and bad for people I'm using this script array=( dull boring annoying bad ) for i in "${array[@]}" do cat $p | sed -e 's/\<$i\>//g' done < my_text.txt But I got the following wrong result: These boring cards are part of a chaotic board game ,and bad for people