Getting started with Cygwin.

Print Friendly

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.

 


Step 9.  Thats all.

 

 

 

 

Ishan Karve

About Ishan Karve

Ishan Karve is just an every day normal guy next door who happens to be an Electronics Engineer by profession and dabbles with PHP, Javascript, C++ and python. His interests vary as seasons change.. they change from astronomy to soul searching. This site is just a reflection of what he does to keep his mind engaged when he is not occupied by work and family. He is an extremely objective guy and is always ready for some good arguments.. of course over a glass of 40% proof alcohol.
This entry was posted in DIY and tagged , , , , , , , . Bookmark the permalink.

62 Responses to Getting started with Cygwin.

  1. Pingback: Cygwin desktop | Tresencuerados

  2. Dilip says:

    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?

  3. Ishan Karve Ishan Karve says:

    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.

  4. Dilip says:

    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?

  5. Pingback: Simple Script to Download epaper from The Hindu | Reverse Biased

  6. Sreekanth BG says:

    incase ur behind corporate firewall, u can set ur HTTP proxy as an environment variable:
    export http_proxy=http://username:password@host:port/

  7. Vijayaraghavan says:

    how to run the shell script in samsung galaxy tab 7 plus

  8. Vaibhav says:

    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

  9. mukesh says:

    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.

  10. mukesh says:

    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.

  11. mas says:

    When I select the edition get error msg as
    ./The_Hindu_Delhi.sh: line 38: wget: command not found
    How to fix it

    • Ishan Karve Ishan Karve says:

      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

  12. mukesh says:

    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.

  13. SIVA says:

    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

    • Ishan Karve Ishan Karve says:

      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

  14. Abhishek says:

    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

  15. Saad says:

    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

  16. starringman says:

    i am getting syntax error
    line 20:syntax error near unexpected token’$'in\r”
    line 20:case $ed in

  17. Tracey says:

    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?

  18. Shiv says:

    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

  19. Anurag Mohan says:

    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……..

  20. Amol says:

    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.

    • Ishan Karve Ishan Karve says:

      Hi Amol, you can try to follow the instructions on the page.. if u have a specific query, I will gladly answer

      • Amol says:

        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

  21. Ankur says:

    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 ~
    $

  22. Amol says:

    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.

  23. Sibnath says:

    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’

  24. Ashok Kumar says:

    thanx man, it really worked..

  25. Ishan Karve Ishan Karve says:

    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.

  26. Amol says:

    Hi Ishan,
    Can I download specific page number from hindu epaper?

  27. Nitin Saxena says:

    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

  28. Nitin Saxena says:

    ohh.. ok I got it. I changed the date and it worked like charm !! Thanks…

  29. pranay kothari says:

    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…

  30. pranay kothari says:

    ishan i have installed it but again i am getting the same error …please help me out..

    • pranay kothari says:

      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..

      • pranay kothari says:

        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 .

  31. rahul maheswari says:

    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..

  32. pramod paatil says:

    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

  33. Nikunj says:

    Hi Ishan,

    Have you tried to run bash script for Indian Express lately? Because lately it downloads ads of “readwhere” app and not newspaper. Please check it out and update your script. Thanks.

  34. soni says:

    Enter edition you wish to selec[0-4]: 2
    Thanks.
    Estimating number of pages in Delhi edition
    Searching for Page 001
    Remote file does not exist — broken link!!!Forbidden. connected./20131008A_001103.pdf
    ./The_Hindu_Delhi.sh: line 46: clear: command not found
    Estimating number of pages in Delhi edition supplement
    Searching for Page 001
    Remote file does not exist — broken link!!!Forbidden. connected./20131008B_001103.pdf
    ./The_Hindu_Delhi.sh: line 69: clear: command not found
    mkdir: cannot create directory `KUMAR/Desktop/hindu_Delhi_08102013′: No such file or directory
    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: /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:1169/1684(ro)(G)– –dict:0/20(G)– –dict:77/200(L)–
    Current allocation mode is local
    Last OS error: Is a directory
    GPL Ghostscript 9.06: Unrecoverable error, exit code 1
    rm: cannot remove `/home/SONIL’: Is a directory
    rm: cannot remove `KUMAR/Desktop/hindu_Delhi_08102013/*.*’: No such file or directory
    rmdir: failed to remove `KUMAR/Desktop/hindu_Delhi_08102013′: No such file or directory

    Ishan sir help me plz..

  35. Mano says:

    $ ./the_hindu.sh
    Hindu epaper editions are
    ————————————————-
    0. Chennai
    1. Hyderabad
    2. Delhi
    3. Bangalore
    4. Kochi
    ————————————————-
    ./the_hindu.sh: line 20: syntax error near unexpected token `$’in\r”
    ‘/the_hindu.sh: line 20: ` case $ed in

    Please tell me reason for this error and how to correct it ??

  36. shiva says:

    Hello Sir…I am getting these 4 error messages. Please post a solution.
    line 93: wget: command not found.
    line 106: wget: command not found.
    line 113: gs: command not found.
    No such file or directory.

  37. Ashwin says:

    I need some help in installing cygwin. I have downloaded the packages separately because of a slow internet connection that kept failing periodically. So I am trying to install from a local directory. When I go through the various steps of setup.exe it does not do any installation at all. Any clues ?

Leave a Reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>