Recently I was inundated with queries, asking me how to run shell scripts using Cygwin. This illustrated guide is primarily meant to address the issue of running shell scripts posted on this site on a WindoZe machine.
I assume that your machine has a working internet connection and is connected to internet. I am going to be economical on words and let the screenshot speak.
Step 1. Download Cygwin.
Step 2. Execute the Cygwin executable (setup.exe)




















Step 3. After the install is complete, copy the script to Cygwin home folder. By default home folder is located at C:\cygwin\home\User
Step 4. Run Cygwin terminal from the Start menu -> Programs -> Cygwin
Step 5. Chmod +x the script to make it executable
Step 6. Run the script.

Step 7. The script throws up errors as there is no Desktop folder in the home directory
Step 8. mkdir Desktop and run script again.












Pingback: Cygwin desktop | Tresencuerados
But when i run the Cygwin set up file i am getting an “setup.exe is not a valid win32 application” error..pls could u help?
Most probably you are trying to run a 32 bit application on a 64 bit platform OS. Download the appropriate version for your OS. Google is your good friend.
Pc@admin1 ~
$ chmod +x The_Hindu.sh
chmod: cannot access `The_Hindu.sh’: No such file or directory
This is the error i m gettng….what hav i done wrng? can u post clearly?
Pingback: Simple Script to Download epaper from The Hindu | Reverse Biased
incase ur behind corporate firewall, u can set ur HTTP proxy as an environment variable:
export http_proxy=http://username:password@host:port/
how to run the shell script in samsung galaxy tab 7 plus
Dear Vijay
Regrets. Dont own an android device yet!
Paper is not downloaded. A Blank pdf is generated. Getting the following error while running the script
Combining all pages into a single pdf document
GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /ioerror in –run–
Operand stack:
–nostringval– –nostringval– (% Co)
Execution stack:
%interp_exit .runexec2 –nostringval– –nostringval– –nostringval– 2 %stopped_push –nostringval– –nostringval– –nostringval– false 1 %stopped_push 1910 1 3 %oparray_pop –nostringval–
Dictionary stack:
–dict:1161/1684(ro)(G)– –dict:0/20(G)– –dict:77/200(L)–
Current allocation mode is local
Last OS error: 21
GPL Ghostscript 9.04: Unrecoverable error, exit code 1
rm: cannot remove `/home/VAIBHAV’: Is a directory
rm: cannot remove `KOTICHA/Desktop/hindu_Delhi_24042012/*.*’: No such file or directory
rmdir: failed to remove `KOTICHA/Desktop/hindu_Delhi_24042012′: No such file or directory
Hi Vaibhav,
I will look into the problem.
bye
sir, you are grate because you are fellow sufferer of information but last tow days you are not sharing news papers, may you do it for yours altruistic quality.
Can u tell me which paper
sir, you created news paper archive.it is not updated.may you can because i have not any tecnical knowledge to run this programmee.yours news archive is realy wounderful.
Thanks Mukesh for pointing out. I think its an server error. I will look into it
When I select the edition get error msg as
./The_Hindu_Delhi.sh: line 38: wget: command not found
How to fix it
Hate to say.. but you have not read my instructions properly.
To cut it short .. install wget module under cygwin… google is your best friend.
Thanks
respected sir,when i open archive then there is messes ‘forbidden’ you are not permission…error 404.sir may u solve this problem.sir i want to keep touch with u,can u send me your mail id.can u accept my frindship.
i downloaded cygwin, but when i am executing the_hindu_delhi.sh it is saying that cannot access ‘the_hindu_delhi.sh ‘; no such file or directory……………..
plz help me
Hi Siva
Check the path where you have downloaded the script and the path from where u are running the scripr. They should be same or the path to the downloaded script should be correct.
Happy Reading
Ishan
Hi Ishan,
I am getting this error “Remote file exists and could contain further links, but recursion is disabled — not retrieving.”, is something missing in my installation too?
Abhishek@abverma-win7 ~
$ ./The_Hindu_Delhi.sh
Hindu epaper editions are
————————————————-
0. Chennai
1. Hyderabad
2. Delhi
3. Bangalore
4. Kochi
————————————————-
Enter edition you wish to selec[0-4]: 2
Thanks.
Estimating number of pages in Delhi edition
Searching for Page 001
Spider mode enabled. Check if remote file exists. –2012-06-02 13:59:37– http:/ /epaper.thehindu.com/pdf/2012/06/02/20120602A_001103.pdf Resolving epaper.thehin du.com (epaper.thehindu.com)… 207.210.83.88 Connecting to epaper.thehindu.com (epaper.thehindu.com)|207.210.83.88|:80… connected. HTTP request sent, awaitin g response… 200 OK Length: 0 [text/html] Remote file exists and could contain further links, but recursion is disabled — not retrieving.
Searching for Page 002
————————————————————————————–
Regards,
Abhishek
Hi Abhishek.. what u see is a debug.. its not an error.. Just checks and validates the download links.
Dear Ishan,
I have been a regular visitor to your above website for downloading daily newspapers. I would definitely say how beneficial it has been for me to have the latest news at hand.
However, for the past few weeks your site has been throwing the following error when clicking on the Digital News Aggregator link:
Forbidden
You don’t have permission to access /news_archive on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Please advise what could be the problem. I really appreciate your efforts in keeping this link alive.
Thanks & Best Regards
Saad
i am getting syntax error
line 20:syntax error near unexpected token’$'in\r”
line 20:case $ed in
Can you tell me which script were u running, so that I can recreate that error.
Thaks for the tool. It is quite good and useful. I have a query here. Is it possible to download epaper of a particular date? or In other way is it possible to download the old dated Hindu paper? If so can you publish the syntax for the script?
Thanks Tracey… you can find the script here http://pastebin.com/R3dDuhSC
However there is a caveat, generally I have observed that digital edition are usually stored to a somewhere around 4 weeks. So you may have to try your luck.
hello Ishan, i followed every step told by u but i’m getting following error
SHIV@MyLapT ~
$ ./The_Hindu_Delhi.sh
Hindu epaper editions are
————————————————-
0. Chennai
1. Hyderabad
2. Delhi
3. Bangalore
4. Kochi
————————————————-
Enter edition you wish to selec[0-4]: 2
Thanks.
Estimating number of pages in Delhi edition
Searching for Page 001
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 002
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 003
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 004
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 005
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 006
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 007
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 008
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 009
./The_Hindu_Delhi.sh: line 38: wget: command not found
Searching for Page 010
./The_Hindu_Delhi.sh: line 38: wget: command not found
Please install wget package in cygwin.
long process and sad process……..
if anyone want to download the hindu newspaper for free…then contact me at anupar2@gmail.com
no software needed…no downloading……just click and download FOR FREEEEEEEE……..
Hello Ishan,
Could you please tell me how to download Hindu epaper, i dont have much knowledge about script, cygwin, etc. but know how to install application, formatting etc, if you give some text or video tutorial for downloading epaper it would be helpful for me.
Waiting for u r reply.
Hi Amol, you can try to follow the instructions on the page.. if u have a specific query, I will gladly answer
Hello Ishan,
I tried to follow instruction on page i am getting this error The_Hindu.sh
chmod: cannot access `The_Hindu.sh’: No such file or directory
————————————–
I have read one of earlier comments-
Question——but when i am executing the_hindu_delhi.sh it is saying that cannot access ‘the_hindu_delhi.sh ‘; no such file or directory…..
Ur answer—case ur behind corporate firewall, u can set ur HTTP proxy as an environment variable:
export http_proxy=http://username:password@host:port/
————————————————————–
I copied this in cygwin (export http_proxy=http://username:password@host:port/)
but i am getting same error.( i think
1.i am unable to understand this—>HTTP proxy as environment variable
2.user name password here
Amol check step 3 in the post
Hi ishan,
I am able to download the pages with the help of software. In the next step, when it combines the individual pages, all the pages from directory Desktop gets deleted and the combined pdf could not be located. Is there something missing in the package or am i missing any step?
./The_Hindu_Delhi.sh: line 69: clear: command not found
Please be patient..Bandwidth intensive operation starts..;-)
Downloading Main Paper .. total 22 pages
Downloading Page 001
Downloading Page 002
Downloading Page 003
Downloading Page 004
Downloading Page 005
Downloading Page 006
Downloading Page 007
Downloading Page 008
Downloading Page 009
Downloading Page 010
Downloading Page 011
Downloading Page 012
Downloading Page 013
Downloading Page 014
Downloading Page 015
Downloading Page 016
Downloading Page 017
Downloading Page 018
Downloading Page 019
Downloading Page 020
Downloading Page 021
Downloading Page 022
Downloading Supplement .. total 4 pages
Downloading Page 001
Downloading Page 002
Downloading Page 003
Downloading Page 004
Combining all pages into a single pdf document
./The_Hindu_Delhi.sh: line 106: gs: command not found
Ankur@Ankur-HP ~
$
Ishan, can you plz tell me what should I do?
Hello Ishan,
I followed Step 3 as you told, it worked. Thank you.
How can i download earlier days epaper? I downloaded and copied whole script from http://pastebin.com/R3dDuhSC and copied in command — enter edition you want to select. it didnt work. and tried differ other ways also. Plz tell me procedure or image tutorial for downloading earlier day papers.
Hello Ishan,
I’m facing d followin problem can u suggest me
‘ Combining all pages into a single pdf document
./The_Hindu_Delhi.sh: line 106: gs: command not found
rm: cannot remove `/home/user/Desktop/hindu_Delhi_15092012/*.*’: No such file or directory’
Check whether vu have downloaded the script to the correct directory
thanx man, it really worked..
Thanks Ashok for those words.
Dhanyawad Amol
Yes u can change the date on your PC to get earlier editions. However this is not foolproof. Newspapers only keep old editions only for few weeks and this trick may not work with Indian Express script.
With regards to increasing bsnl broadband speed.. sorry friend can’t give u much info on that.. however try Google chrome on a Linux box.
No matter bro, I will try that.
Thank you.
Hi Ishan,
Can I download specific page number from hindu epaper?
i tried exactly as mentioned by you in the screenshots but I guess something is wrong. Here is the message i am getting. Can u figure out whats wrong?
$ ./The_Hindu_Delhi.sh
Hindu epaper editions are
————————————————-
0. Chennai
1. Hyderabad
2. Delhi
3. Bangalore
4. Kochi
————————————————-
Enter edition you wish to selec[0-4]: 2
Thanks.
Estimating number of pages in Delhi edition
Searching for Page 001
Spider mode enabled. Check if remote file exists. –2012-10-17 01:15:55– http://epaper.thehindu.com/pdf/2012/10/17/20121017A_001103.pdf Resolving epaper.thehindu.com (epaper.thehindu.com)… 207.210.83.88 Connecting to epaper.thehindu.com (epaper.thehindu.com)|207.210.83.88|:80… connected. HTTP request sent, awaiting response… 404 Not Found Remote file does not exist — broken link!!!
./The_Hindu_Delhi.sh: line 46: clear: command not found
Estimating number of pages in Delhi edition supplement
Searching for Page 001
Spider mode enabled. Check if remote file exists. –2012-10-17 01:15:58– http://epaper.thehindu.com/pdf/2012/10/17/20121017B_001103.pdf Resolving epaper.thehindu.com (epaper.thehindu.com)… 207.210.83.88 Connecting to epaper.thehindu.com (epaper.thehindu.com)|207.210.83.88|:80… connected. HTTP request sent, awaiting response… 404 Not Found Remote file does not exist — broken link!!!
./The_Hindu_Delhi.sh: line 69: clear: command not found
Please be patient..Bandwidth intensive operation starts..;-)
Downloading Main Paper .. total 0 pages
Downloading Supplement .. total 0 pages
Combining all pages into a single pdf document
GPL Ghostscript 9.06 (2012-08-08)
Copyright (C) 2012 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefinedfilename in (/home/nitin/Desktop/hindu_Delhi_17102012/*.pdf)
Operand stack:
Execution stack:
%interp_exit .runexec2 –nostringval– –nostringval– –nostringval– 2 %stopped_push –nostringval– –nostringval– –nostringval– false 1 %stopped_push
Dictionary stack:
–dict:1169/1684(ro)(G)– –dict:0/20(G)– –dict:77/200(L)–
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.06: Unrecoverable error, exit code 1
rm: cannot remove `/home/nitin/Desktop/hindu_Delhi_17102012/*.*’: No such file or directory
ohh.. ok I got it. I changed the date and it worked like charm !! Thanks…
i am getting error “The_Hindu_Delhi.sh: line 106: gs: command not found ”
and i have done everything in order as u have given…please help
is there any problem in line 106 or what…
Please install ghostscript. Ur problem will be solved. Thanks.
ishan i have installed it but again i am getting the same error …please help me out..
Combining all pages into a single pdf document
./The_Hindu_Delhi.sh: line 106: gs: command not found
rm: cannot remove `/home/pranay/Desktop/hindu_Delhi_28102012/*.*’: No such file or directory
rmdir: failed to remove `/home/pranay/Desktop/hindu_Delhi_28102012′: No such file or directory
above is what i have got …after installing ghostscript..
getting the below error please tell me how to remove it…
Combining all pages into a single pdf document
./the_hindu_newspaper.txt: line 106: gs: command not found
rm: cannot remove `/home/pranay/Desktop/hindu_Hyderabad_31102012/*.*’: No such file or directory
rmdir: failed to remove `/home/pranay/Desktop/hindu_Hyderabad_31102012′: No such file or directory
.
tell me something different .
Execution stack:
%interp_exit .runexec2 –nostringval– –nostringval– –nostringval– 2 %stopped_push –nostringval– –nostringval– –nostringval– false 1 %stopped_push
Dictionary stack:
–dict:1169/1684(ro)(G)– –dict:0/20(G)– –dict:77/200(L)–
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.06: Unrecoverable error, exit code 1
rm: cannot remove `/home/pranay/Desktop/hindu_Delhi_31102012/*.*’: No such file or directory
rmdir: failed to remove `/home/pranay/Desktop/hindu_Delhi_31102012′: No such file or directory
sir i am getting above error ..tell me what to do..
Hi rahul
I will try tk have a look
Thanks
Rahul I checked the script on my linux box … did not see any problem
i am able to get the pdf but not able to combine all the pdf into single file…can u tell me what to do..is there in file i am missing