2
0
I'm trying to get a hang of grep. I've got the following command from a GeekLet script that someone made for getting the weather info off some website:
curl -s 'http://thefuckingweather.com/?zipcode=61820' | grep '"content\|"remark\|span' || sed 's/<[^>]*>//g' | sed 's/]*>//g' | sed 's/°/°/'
I'm not worried about the sed command right now. I know it clears up the output to be neatly formatted, but for now I'm just trying to figure out the grep command.
I have a couple of questions that none of the guides/manuals over there seem to have a clear answer for:
- What does the backslash (
\
) do over here? - What do the pipes "|" in between do?
- Why is "content\|" in double quotes?
Also any other ideas/guides that you know of which touch upon parsing html content with grep?
Thank you! That cleared it up. Also if someone else needs to know more about this I found a good grep resource here: http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/
– Sid – 2012-12-08T09:46:10.987