I tried using this code to delete all files containing specific expressions.
# ! /bin/ bash
for i in `ls `; do
if [ ! -d $i ] && ([$i = violence] || [$i = hatred] || [$i = war]); then
rm $i
fi
done
I am getting the following error (There are two files in this directory, "war" and "hatred"):
[hatred: command not found
[hatred: command not found
[hatred: command not found
[war: command not found
[war: command not found
[war: command not found
Could you point me to the problem ?