I need a bash command to delete the entire file if the file itself begins with <html>
.
I'm not sure the best way to go about this...
Context: I download a series of files via curl requests. Most time the downloads and processing work fine. But other times the download request results in a 404 for whatever reason. When I get those, the contents of the downloaded file begins with a html tag. When the rest of my processing hits this file, it hangs. So I want to run a command prior to my other processing to cat each of the files and delete the file if it has this html tag.
<html>
or delete a file that has<html>
in its name? – Seth Oct 28 '14 at 4:17<!doctype something>
. – Kroltan Oct 28 '14 at 10:58