Mooblar Posted January 16, 2009 Share Posted January 16, 2009 Hi, I'm building my own "Sms service" I've already configured my sms gateway, So my idea is that I wanna be able to send a sms to my gateway which then runs a script that will wget a a site (Where my teachers write what homework I should do etc), now this is where my problems is, I've found out the tags around the message like this eg. <tag>Homework</tag>. Now I want grep (or awk sed etc) to sort out the variable(homework). So if i do a $> cat bla.html <tag>Do this and that</tag> Then i want to do $> cat | grep Some wildcard thingy (so it sorts out "Do this and that") Do this and that Sorry for my poor english, i'm pretty tired so i might edit it tomorrow :> I hope you got my point ;) Thanks! Quote Link to comment Share on other sites More sharing options...
atsui Posted January 17, 2009 Share Posted January 17, 2009 Then i want to do $> cat | grep Some wildcard thingy (so it sorts out "Do this and that") Do this and that Hi, After you grep the line you want, you can pipe it to sed to strip the tags: sed -e 's/<[^>]*>//g I tried it with a HTML file. It takes <tag>X</tag> and leaves X. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.