I want to remove a line that contains <premiered>
in *.nfo files including subdirectories.
This is the command that I use
find . -type f -name '*.nfo' -exec sh -c '
file="$0"
echo "$file"
sed -i -e '/<premiered>/d' "&file"
read line </dev/tty
' {} ';'
Unfortunately, all i get is
-bash: premiered: No such file or directory
Whats the problem and how can i fix that?
<premiered
is exposed to the shell (and is interpreted as a redirection). Why do you think it necessary to wrap thesed
command in ash -c
?xargs
wouldn't work, but it should be possible to run sed directly via -exec i.e.find . -type f -name '*.nfo' -exec sed -i -e '/<premiered>/d' {} \;