I'm trying to remove stop words from sentences in file?
Stop Word which I mean :
[I, a, an, as, at, the, by, in, for, of, on, that]
I have these sentences in file my_text.txt :
One of the primary goals in the design of the Unix system was to create an environment that promoted efficient program
Then I want to remove stop word form the sentence above
I used this script :
array=( I a an as at the by in for of on that )
for i in "${array[@]}"
do
cat $p | sed -e 's/\<$i\>//g'
done < my_text.txt
But the output is:
One of the primary goals in the design of the Unix system was to create an environment that promoted efficient program
The expected output should be :
One primary goals design Unix system was to create an environment promoted efficient program
Note: I want to Delete Remove stop words not duplicated words?