Search and replace text in multiple files.

I had a bunch of html files where a particular style sheet inclusion had to be removed from about 500 odd html files.

Knew this could be done through an sed script , but found a better one using perl from here.

export OLD_TEXT='<link rel=”stylesheet” type=”text/css” href=”style.css”>’

export NEW_TEXT=’some new text’

and use it in the perl command as follows.

perl -w -i -p -e “s/$OLD_TEXT/$NEW_TEXT/g” *.html

or use it against all .html files from the current directory using find and xargs

find . -name “*.html” | xargs -i perl -w -i -p -e “s/$OLD_TEXT/$NEW_TEXT/g” {}

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

Get PNR status on your mobile sms. Powered by Google

Google has a host of mobile products for the Indian market, the full list can be seen here. Among them, the pick of the lot is the SMS product, using which one can get instant PNR status for your Indian railway ticket reservation.

Excerpts from the page here.

Get cricket scores, Indian Railways train schedules & ticket status, horoscopes, movie showtimes, restaurant information and more …all through SMS on your phone.

Best of all, you don’t pay a premium charge for any of this, just the price of a standard SMS.

Try it out! Simply send your search query by SMS to 9-77-33-00000 and we’ll send you results back by SMS immediately.

Of course, don’t forget to save 9-77-33-00000 to your phonebook for quick and easy access to Google SMS in the future!

There are no premium charges for this service, only the cost of sending a standard SMS. Incoming messages from Google are not charged.

Also there are host of other services we can use too. Found them useful. Like movies, news, train fare, local business etc.