05 October 2012

A script to check PNR status

# cat << EOF > pnrdata
lccp_pnrno1=MYPNRNO
EOF

# cat pnrdata
lccp_pnrno1=MYPNRNO

# url=http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi
# lynx -post_data $url < ./pnrdata | 
  grep -A32 PNR | grep "Passenger [0-9]"
   Passenger 1 W/L 114,GNWL W/L 21

wget --user-agent="Myscript 1.0;" \
--header="Content-Type: application/x-www-form-urlencoded" \
--post-data="lccp_pnrno1=MYPNRNO" \
"http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi" -O- 2>/dev/null \
| grep -A2 "Passenger 1"
<TD class="table_border_both"><B>Passenger 1</B></TD>
<TD class="table_border_both"><B>W/L  114,GNWL  </B></TD>
<TD class="table_border_both"><B>W/L   21</B></TD>


Reference:
http://wiki.linux-delhi.org/cgi-bin/twiki/view/Main/LinuxTricks
http://akhileshss.blogspot.com/2008/09/script-to-periodically-check-pnr-status.html

20 comments:

  1. For PNR Enquiry I prefer internet sites with lesser ads on it.

    ReplyDelete
  2. First of all, thanks for sharing such a valuable piece of information. Railway PNR Status

    ReplyDelete
  3. Thanks for sharing such a valuable resource. I appreciate your effort, this resource is really useful for me as well as everyone. I hope you will keep sharing such information in future. I usually check pnr status through irctc login.

    ReplyDelete
  4. You have shared this info which is useful for people, so liked to share some too. For pnr enquiry you can call and text on 139, it's a Indian railways toll free number, it will help you out. Beside, I know a website named: Irctc login, which you can use for online pnr enquiry, go for it's really cool.

    ReplyDelete
  5. Indian Railways official website is the best way to track on the pnr status of your the railway ticket. But you know it's limited to train only. I mean from here you can check train pnr status only. But what about flight, if you wanna check pnr status of your airline ticket, what you are going do. Don't worry i got the solution, there is a website: PNR Status, it's not only allow to check pnr status of railway ticket but also of various major airlines.

    ReplyDelete
  6. Thanks for sharing this information. Few weeks ago while searching over the web i came across irctc pnr status. It's not only let you check pnr but also seat availability, train schedule, station code and various other things. It's has various amusing features which sites that you have mentioned doesn't, just have a look on it.

    ReplyDelete
  7. There are many websites to Check IRCTC PNR Status but I always prefer the official website of Indian Railways as it always provides the right information.

    ReplyDelete
  8. Thanks for sharing the script. However, I found the best way to check Indian Railways PNR status. You can also check train time table, light PNR status, and number of seats available; all in one place. You can visit that as well.

    ReplyDelete
  9. 3rd party websites are providing all the relevant information associated to Indian Railways. Not only PNR enquiry, but you can also check train schedules, reservation status of flight, seat availability, etc.

    ReplyDelete
  10. Now a days IndiaRail using captcha, this script may not work.
    You can use this latest website to check your pnr status

    ReplyDelete
  11. can someone help me in adding this to my website?

    ReplyDelete
  12. There are number of sites for PNR Status of train. but i suggest you go for best. today number of the best site offer online services.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. You can Check Railway PNR status of your railway ticket online on IndianTrain. It Provide fast and accurate results for all the train enquiries.

    ReplyDelete