Another method to get the sensex. This method is more realiable in working – but the data might be a bit old. Data supplied by Yahoo Finances.
curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=%5EBSESN&f=sl1d1t1c1ohgv&e=.csv'| awk -F ',' '{print $2}'