Subaru Forester Owners Forum banner

How to - service manuals, from STIS 3 day subscription (Merged)

(All Years) 
170K views 157 replies 74 participants last post by  Kevin 
#1 · (Edited)
Admin Note Refer here for the latest: https://www.subaruforester.org/thre...ubscription-merged.271290/page-8#post-7900984


From the staff:

Forum Rules - Please read!

5. We do not allow the distribution of copyrighted material, such as links to illegal download sites for service manuals, music, pirated software, etc.
Since there always seems to be a lot of service manual threads/questions when a new new model year comes out and the answers haven't changed there is now this sticky.

Common questions:
  1. Where can I get a manual and how much will it cost?
  2. What about 3rd party manuals like Haynes or Chilton?
  3. Ebay manuals, are they good?
  4. I found a manual online for free.

Answers:
  1. You can get a paper manual at your dealer, just be prepared for a sticker shock moment. The paper copies run between $400-$700 depending on what dealer you get them from and any discount that is given to you.

    You can also download a PDF copy from Subaru Technical Information System - Welcome . This is Subaru's online resource system. It is a mix of items that you need to pay for access to get and others that are free like accessory install sheets and Owners manuals.

  2. Third party manuals,
    Haynes is the information resource for the DIY enthusiast or Do It Yourself and DIY Auto Repair by ChiltonDIY and ALLDATAdiy.com Leading Source of Factory Automotive Repair Information

    They are fine for some people. They offer the basic information needed by many for typical repairs. The catch is often they lack the in depth info needed on some topics and have more errors that don't get updated. They can be a good tool when used for the right task.

    Another good source for the casual user can also be Membership Benefits | AutoZone.com They offer some limited online repair guides to members. They don't offer everything but enough to get the average owner by when needed.

  3. Ebay manual downloads and CD's, Most are nothing more than a Pirated manual that is being sold via a Ebay storefront.

  4. Pirated manuals, A manual that some one at some time downloaded from STIS and put online for others to grab. Pirated manuals are again one of those that may be out of date and lack the latest information as they have likely been out in the wild for years.

    On that note, Subaru Service Manuals are copyrighted. Don't go posting links to these downloads on the forum. They will be removed and you will likely get points, a vacation or be banned.



------------------------------------------------------------------------------------------------------------------------------



FlashEngineer's post

I did a write up for the 2014, it should work with any year, you just gotta buy the 3 day pass and edit the script for the correct path for that manual.

Easily done, got this from a thread of Outback forums.

IMPORTANT This method only works on a linux machine with working bash/sh/csh etc SHELL, use Ubuntu, Fedora etc or even Cygwin. WILL NOT WORK ON WINDOWS COMMAND LINE!!!.

You have been warned


Basically go to: Subaru Technical Information System

1). You need to purchase the 3 day pass.

2). Login and grab your cookie sessionID, I use Chrome and just right click, view page info and cookies, find the one for techinfo.subaru.com, looks something like this:

8912c3fe0896346712dff6e24f97

***Keep your browser opened. DO NOT CLOSE BROWSER FOR ANY REASON OR THIS WON'T WORK.

3). Copy that and put that in text file. Name it "cookie" because that's what my script uses. Copy this and replace the cookie hash at the end:

Code:
techinfo.subaru.com    FALSE    /    FALSE    0    JSESSIONID    8912c3fe0896346712dff6e24f97
4). Now leave your computer on for ~24-25 hours to run this since there's 50 limit per hour the implemented, still enough to do the 72 hour window you got.

5). This is basic bash script, name it whatever.sh and change permissions. Run it in the directory you want to store the files, there will be 1163 PDF's(for a 2014 XT).

Code:
star=1 #starting item #
fin=1163 #last item #

#For through all docs on page
for i in $(seq $star $fin)
do

## Tell where we are in the process (print to screen)
echo "***DEBUG*** "$i"  item G8190BEV11_"$i" received "$(date +"%c")"******"

#If using \ to escape "newlines" (ie go to the next line) ensure no spaces after \
curl -L \
--cookie cookie \
"http://techinfo.subaru.com/proxy/74888/pdf/serviceManual/074888_2014_Forester/\
G8190BEV11_"$i".pdf" \
> "G8190BEV11_"$i".pdf"

##If this is the 50th doc OR the last in the series, then sleep for 60 minutes and ...
##    ... one second. Otherwise between vehicle sets you may get an error.
if !(($i%50)) || (($i==$fin)); then sleep 3601; fi

done #with docs on page
 
See less See more
#6 · (Edited)
Another way to download and combine the PDFs on a Mac

[NOTE: As noted in a reply I forgot to take into account the 50 downloads per hour limit- sorry! It may still be handy for the things that are less than 50 .pdf links per page. I'll see if there's a way to make it work easily in Automator, but I suspect it may end up having to be split into multiple workflows that call each other, at which point it would be likely easier to edit the UNIX script to work on a Mac and and perhaps use Automator to implement it and then manipulate the resulting downloaded .PDF files. Stay tuned!]

Hi- I'm just shopping for a Forester so I haven't subscribed to try the following method on the Technical manual, but it seems to work find on the 2014 Subaru Forester's Owner Manual, which is freely available.

Mac OS X includes some great scripting technologies that can be easily scripted using Automator. It's possible the Unix script will work as OS X is unix based, but Automator is a bit more approachable for most folk.

The following method will download all of the PDFs on the search page and combine them into one master document. It works off of whatever page Safari has open. This was a small challenge as the search page didn't show the URLs to download in it's live view. I found a workaround by simply saving the page as a Web Archive, then opening the web archive.

Steps:
  • Create a Folder to contain all the "Stuff" (ex 2014 Forester Owner's Manual)
  • In Safari, search for and view the technical manual page you wish to download from.
  • File-->Save As Name your file (ex: 2014 Subaru Forester Manual) and choose "Web Archive" for the type and save this in the folder you created.
  • Open the web archive file you've created and make sure it's the formost open Safari window.
  • Open Automator and create a new work flow.
  • Create the workflow as in the attached images, with the noted adjustments in names and folder selections. The workflow is created by dragging the Actions from the list into the workflow section, in order. The needed actions are in the PDFs section and the Files&Folders section.
  • Save the workflow in the same folder
  • Run the workflow

The individual PDF sections will be downloaded, combined (in alphabetical order), and the combined PDF will open.

The combined PDF will likely have some pages oriented sideways- I haven't find an automatic fix. In the Preview.app it's easy to fix this by selecting View->Show Thumbnails. Select the "Sideways" pages (use the shift key to select a range of pages) and choose Tools-->Rotate Right


Image 2-19-14 at 10.29 PM by snourse13, on Flickr

Image 2-19-14 at 10.29 PM (1) by snourse13, on Flickr



Attached is my Automator workflow file in .zip format-- It was created in Mac OS X 10.9-- I'm not sure if it will open in earlier versions.

If anyone gets a chance to try this under a subscription (for the Technical manual) I'd love to know how it works for you.

This method seems to work fine for the free manuals.

Please let me know if there are any questions- thanks to the original thread poster FlashEngineer for the idea and great information!
 

Attachments

#63 ·
[NOTE: As noted in a reply I forgot to take into account the 50 downloads per hour limit- sorry! It may still be handy for the things that are less than 50 .pdf links per page. I'll see if there's a way to make it work easily in Automator, but I suspect it may end up having to be split into multiple workflows that call each other, at which point it would be likely easier to edit the UNIX script to work on a Mac and and perhaps use Automator to implement it and then manipulate the resulting downloaded .PDF files. Stay tuned!]

Hi- I'm just shopping for a Forester so I haven't subscribed to try the following method on the Technical manual, but it seems to work find on the 2014 Subaru Forester's Owner Manual, which is freely available.

Mac OS X includes some great scripting technologies that can be easily scripted using Automator. It's possible the Unix script will work as OS X is unix based, but Automator is a bit more approachable for most folk.

The following method will download all of the PDFs on the search page and combine them into one master document. It works off of whatever page Safari has open. This was a small challenge as the search page didn't show the URLs to download in it's live view. I found a workaround by simply saving the page as a Web Archive, then opening the web archive.

Steps:
  • Create a Folder to contain all the "Stuff" (ex 2014 Forester Owner's Manual)
  • In Safari, search for and view the technical manual page you wish to download from.
  • File-->Save As Name your file (ex: 2014 Subaru Forester Manual) and choose "Web Archive" for the type and save this in the folder you created.
  • Open the web archive file you've created and make sure it's the formost open Safari window.
  • Open Automator and create a new work flow.
  • Create the workflow as in the attached images, with the noted adjustments in names and folder selections. The workflow is created by dragging the Actions from the list into the workflow section, in order. The needed actions are in the PDFs section and the Files&Folders section.
  • Save the workflow in the same folder
  • Run the workflow

The individual PDF sections will be downloaded, combined (in alphabetical order), and the combined PDF will open.

The combined PDF will likely have some pages oriented sideways- I haven't find an automatic fix. In the Preview.app it's easy to fix this by selecting View->Show Thumbnails. Select the "Sideways" pages (use the shift key to select a range of pages) and choose Tools-->Rotate Right


Image 2-19-14 at 10.29 PM by snourse13, on Flickr

Image 2-19-14 at 10.29 PM (1) by snourse13, on Flickr



Attached is my Automator workflow file in .zip format-- It was created in Mac OS X 10.9-- I'm not sure if it will open in earlier versions.

If anyone gets a chance to try this under a subscription (for the Technical manual) I'd love to know how it works for you.

This method seems to work fine for the free manuals.

Please let me know if there are any questions- thanks to the original thread poster FlashEngineer for the idea and great information!
Scottn57,

I'm running your Automator script and continue to get the following error in Automator, after the "Download URLs" step appears to complete (taking between 60 and 90 seconds):

"The action Move Finder Items encountered an error. No item references were passed to the Move Finder Items action."

I am logged into STIS correctly, and the webarchive I created is open and the foremost window in safari, per instructions.

Any ideas where I'm going wrong?

Thanks!
Matt
 
#15 ·
Can this be done in Windows 7. I am pretty PC and Windows savvy but I have little or no experience with writing scripts.

Thanks

Brian Sanborn
Groton, MA
Bump...

I am also looking for a way to automate the download in windows 7 so I can get the manuals for my 2014 Forester. I don't have a MAC or a Linux machine so these scripts won't run for me.... :icon_confused:
 
#13 ·
Printed Copy of Factory Service Manual

For almost every car I have ever owned, I have bought the service manual and wiring diagrams manual. They usually cost well under $200 at the discount parts dealer for that brand. The Subaru manuals seem to be an unusual exception.

Based on reading the forum, I have successfully downloaded the 2014 Forester Factory Service Manual and the Mechanism & Function Manual from the Subaru Tech Info website by using my custom script on my Ubuntu Linux system. Like others on the forum have suggested, I made a HTML webpage that lets me browse the 1163 PDF files from a table of contents. I wish I had Adobe Acrobat so I could join all 1163 files into one larger PDF file.

But I would prefer to have a bound printed copy. The forum indicates that they cost from $200-$600 depending on discounts provided by the parts dealer. What is the story on these printed manuals I can't find any discount parts dealers selling these online. I'll ask my dealer parts dept, but my guess is that they will charge the most that they can get away with.

Thanks

Brian Sanborn
Groton, MA
 
#17 ·
From the staff:

Forum Rules - Please read!



Since there always seems to be a lot of service manual threads/questions when a new new model year comes out and the answers haven't changed there is now this sticky.

Common questions:
  1. Where can I get a manual and how much will it cost?
  2. What about 3rd party manuals like Haynes or Chilton?
  3. Ebay manuals, are they good?
  4. I found a manual online for free.

Answers:
  1. You can get a paper manual at your dealer, just be prepared for a sticker shock moment. The paper copies run between $400-$700 depending on what dealer you get them from and any discount that is given to you.

    You can also download a PDF copy from Subaru Technical Information System - Welcome . This is Subaru's online resource system. It is a mix of items that you need to pay for access to get and others that are free like accessory install sheets and Owners manuals.

  2. Third party manuals,
    Haynes is the information resource for the DIY enthusiast or Do It Yourself and DIY Auto Repair by ChiltonDIY and ALLDATAdiy.com Leading Source of Factory Automotive Repair Information

    They are fine for some people. They offer the basic information needed by many for typical repairs. The catch is often they lack the in depth info needed on some topics and have more errors that don't get updated. They can be a good tool when used for the right task.

    Another good source for the casual user can also be Membership Benefits | AutoZone.com They offer some limited online repair guides to members. They don't offer everything but enough to get the average owner by when needed.

  3. Ebay manual downloads, Most are nothing more than a Pirated manual that is being sold via a Ebay storefront.

  4. Pirated manuals, A manual that some one at some time downloaded from STIS and put online for others to grab. Pirated manuals are again one of those that may be out of date and lack the latest information as they have likely been out in the wild for years.

    On that note, Subaru Service Manuals are copyrighted. Don't go posting links to these downloads on the forum.

    Forum Rules - Please read!

    They will be removed and you will likely get points, a vacation or be banned.
------------------------------------------------------------------------------------------------------------------------------
FlashEngineer's post

I did a write up for the 2014, it should work with any year, you just gotta buy the 3 day pass and edit the script for the correct path for that manual.

Easily done, got this from a thread of Outback forums. This method is on linux machine, use Ubuntu or whatever flavour.

Basically go to: Subaru Technical Information System

1). You need to purchase the 3 day pass.

2). Login and grab your cookie sessionID, I use Chrome and just right click, view page info and cookies, find the one for techinfo.subaru.com, looks something like this:

8912c3fe0896346712dff6e24f97

Keep your browser opened.

3). Copy that and put that in text file. Name it "cookie" because that's what my script uses. Copy this and replace the cookie hash at the end:

Code:
techinfo.subaru.com	FALSE	/	FALSE	0	JSESSIONID	8912c3fe0896346712dff6e24f97
4). Now leave your computer on for ~24-25 hours to run this since there's 50 limit per hour the implemented, still enough to do the 72 hour window you got.

5). This is basic bash script, name it whatever.sh and change permissions. Run it in the directory you want to store the files, there will be 1163 PDF's(for a 2014 XT).

Code:
star=1 #starting item #
fin=1163 #last item #

#For through all docs on page
for i in $(seq $star $fin)
do

## Tell where we are in the process (print to screen)
echo "***DEBUG*** "$i"  item G8190BEV11_"$i" received "$(date +"%c")"******"

#If using \ to escape "newlines" (ie go to the next line) ensure no spaces after \
curl -L \
--cookie cookie \
"http://techinfo.subaru.com/proxy/74888/pdf/serviceManual/074888_2014_Forester/\
G8190BEV11_"$i".pdf" \
> "G8190BEV11_"$i".pdf"

##If this is the 50th doc OR the last in the series, then sleep for 60 minutes and ...
##    ... one second. Otherwise between vehicle sets you may get an error.
if !(($i%50)) || (($i==$fin)); then sleep 3601; fi

done #with docs on page

Can you help me out with this script? Trying to get the 2015 Forester manual.

I made changes to the above script and here is what I came up with:

star=1 #starting item #
fin=1169 #last item #

#For through all docs on page
for i in $(seq $star $fin)
do

## Tell where we are in the process (print to screen)
echo "***DEBUG*** "$i" item G8200BEV1_"$i" received "$(date +"%c")"******"

#If using \ to escape "newlines" (ie go to the next line) ensure no spaces after \
curl -L \
--cookie cookie \
"http://techinfo.subaru.com/proxy/76065/pdf/serviceManual/076065_2015_Forester/\
G8200BEV1_"$i".pdf" \
> "G8200BEV1_"$i".pdf"

##If this is the 50th doc OR the last in the series, then sleep for 60 minutes and ...
## ... one second. Otherwise between vehicle sets you may get an error.
if !(($i%50)) || (($i==$fin)); then sleep 3601; fi

done #with docs on page


Now is this correct and how do I execute it in Windows 7 64bit?
 
#27 ·
This script (or more precisely- the one adjusted for the 2015 Forester manual) worked just fine on my Mac.

I gave up on using Automator since it would have been difficult to make it wait to over come the files per hour download limits. When I get a chance I'll try to write up the process on a Mac. I'd like to also explore making the script parse the particular manual's webpage so that it will work on any manual (year) without changing the script- I'll be off work for some surgery so as long as I can script one handed I may find the time soon.

Thanks to FlashEngineer and everyone else for the write-ups- I'm happy to have a clean/legal/affordable copy of the repair manual!
 
#20 ·
From the staff:

Forum Rules - Please read!



Since there always seems to be a lot of service manual threads/questions when a new new model year comes out and the answers haven't changed there is now this sticky.

Common questions:
  1. Where can I get a manual and how much will it cost?
  2. What about 3rd party manuals like Haynes or Chilton?
  3. Ebay manuals, are they good?
  4. I found a manual online for free.

Answers:
  1. You can get a paper manual at your dealer, just be prepared for a sticker shock moment. The paper copies run between $400-$700 depending on what dealer you get them from and any discount that is given to you.

    You can also download a PDF copy from Subaru Technical Information System - Welcome . This is Subaru's online resource system. It is a mix of items that you need to pay for access to get and others that are free like accessory install sheets and Owners manuals.

  2. Third party manuals,
    Haynes is the information resource for the DIY enthusiast or Do It Yourself and DIY Auto Repair by ChiltonDIY and ALLDATAdiy.com Leading Source of Factory Automotive Repair Information

    They are fine for some people. They offer the basic information needed by many for typical repairs. The catch is often they lack the in depth info needed on some topics and have more errors that don't get updated. They can be a good tool when used for the right task.

    Another good source for the casual user can also be Membership Benefits | AutoZone.com They offer some limited online repair guides to members. They don't offer everything but enough to get the average owner by when needed.

  3. Ebay manual downloads, Most are nothing more than a Pirated manual that is being sold via a Ebay storefront.

  4. Pirated manuals, A manual that some one at some time downloaded from STIS and put online for others to grab. Pirated manuals are again one of those that may be out of date and lack the latest information as they have likely been out in the wild for years.

    On that note, Subaru Service Manuals are copyrighted. Don't go posting links to these downloads on the forum.

    Forum Rules - Please read!

    They will be removed and you will likely get points, a vacation or be banned.
------------------------------------------------------------------------------------------------------------------------------
FlashEngineer's post

I did a write up for the 2014, it should work with any year, you just gotta buy the 3 day pass and edit the script for the correct path for that manual.

Easily done, got this from a thread of Outback forums. This method is on linux machine, use Ubuntu or whatever flavour.

Basically go to: Subaru Technical Information System

1). You need to purchase the 3 day pass.

2). Login and grab your cookie sessionID, I use Chrome and just right click, view page info and cookies, find the one for techinfo.subaru.com, looks something like this:

8912c3fe0896346712dff6e24f97

Keep your browser opened.

3). Copy that and put that in text file. Name it "cookie" because that's what my script uses. Copy this and replace the cookie hash at the end:

Code:
techinfo.subaru.com	FALSE	/	FALSE	0	JSESSIONID	8912c3fe0896346712dff6e24f97
4). Now leave your computer on for ~24-25 hours to run this since there's 50 limit per hour the implemented, still enough to do the 72 hour window you got.

5). This is basic bash script, name it whatever.sh and change permissions. Run it in the directory you want to store the files, there will be 1163 PDF's(for a 2014 XT).

Code:
star=1 #starting item #
fin=1163 #last item #

#For through all docs on page
for i in $(seq $star $fin)
do

## Tell where we are in the process (print to screen)
echo "***DEBUG*** "$i"  item G8190BEV11_"$i" received "$(date +"%c")"******"

#If using \ to escape "newlines" (ie go to the next line) ensure no spaces after \
curl -L \
--cookie cookie \
"http://techinfo.subaru.com/proxy/74888/pdf/serviceManual/074888_2014_Forester/\
G8190BEV11_"$i".pdf" \
> "G8190BEV11_"$i".pdf"

##If this is the 50th doc OR the last in the series, then sleep for 60 minutes and ...
##    ... one second. Otherwise between vehicle sets you may get an error.
if !(($i%50)) || (($i==$fin)); then sleep 3601; fi

done #with docs on page
I've never done anything like this, but I tried to follow your directions as best as possible.

I ran the script and I'm getting the errors:

./ForesterScript.sh: line 3: $'\r': command not found
./ForesterScript.sh: line 6: syntax error near unexpected token `$'do\r''
'/ForesterScript.sh: line 6: `do


I'm not sure what I'm doing wrong? Also, what do you mean by "cookie hash at the end" and "change permissions"?
 
#21 ·
This is all done in linux bash shell, you can't do this in windows unless you convert the scripts to batch file or something. You have to know some basic linux shell to do this, and if you don't get what "change permissions" mean, then I think it might be beyond the scope of this tutorial.

Not sure if you're running this on what platform or shell but the errors you're getting is because you're using some editor that doesn't understand proper ASCII and it's putting some /r and other junk as carriage returns.
 
#22 ·
I do have Cygwin installed for Win 8 64 bit to run the script and I typed the script in notepad. Then I saved it as .sh. That might be the problem, by typing it in notepad and not an editor, haha. I've done some FORTRAN coding, but that's been 3 years.

So it looks like I'm missing a few steps:
  • Need a proper editor
  • Convert the script to batch?
 
#23 ·
IF you're running cygwin, that's enough as a linux shell command, you don't need to convert to batch files. Just use the built in editor like vi or vim or emacs etc. Don't use a windows editor like notepad, it adds unnecessary characters.

Also the bunch of random letters/numbers in the cookie file at the end of the line is called a hash (google it), you need to grab your own login session id hash and put it in, otherwise you won't be able to access as the server won't know it's you.
 
#24 ·
So after about 4hrs of googling and youtube, I finally got the script to compile. However, the files aren't opening and it seems that they aren't being fully downloaded.

Any idea what is wrong? I screenshotted the script, the error from the PDF reader, and the file sizes.
 

Attachments

#28 ·
Script not downloading complete files

I want to get all elements of the 2015 Forester service manual within the limits of a 72-hour subscription, without sitting at my computer all July 4th weekend. This script is a godsend -- thanks!

I'm using the script above to automate downloading, currently testing on the 2015 Forester Owner Manual (I'll purchase a 72-hour subscription only when I get the script working).

I'm running the script inside Cygwin on Windows 8.1.

The script appears to work fine on the 21 PDF's in the owners manual (no errors, pdf's left in directory), but when I try to open any of the resulting PDF files, I find that they are ALL corrupted (Adobe Reader can't open them, and they are ALL exact the same 21K file size). Even more oddly, if I set the $fin value to greater than 21, it will create PDF files for those higher numbers as well (also 21K in size), even though those PDF's don't even exist on the server. So obviously something is wrong with the curl command -- the redirect appears to be creating files without actually downloading the file on the server.

I don't know enough about Linux and the curl command to understand what might be wrong. I know this isn't a Linux forum, but any hints from techies who figured out this approach?
 
#29 ·
I want to get all elements of the 2015 Forester service manual within the limits of a 72-hour subscription, without sitting at my computer all July 4th weekend. This script is a godsend -- thanks!

I'm using the script above to automate downloading, currently testing on the 2015 Forester Owner Manual (I'll purchase a 72-hour subscription only when I get the script working).

I'm running the script inside Cygwin on Windows 8.1.

The script appears to work fine on the 21 PDF's in the owners manual (no errors, pdf's left in directory), but when I try to open any of the resulting PDF files, I find that they are ALL corrupted (Adobe Reader can't open them, and they are ALL exact the same 21K file size). Even more oddly, if I set the $fin value to greater than 21, it will create PDF files for those higher numbers as well (also 21K in size), even though those PDF's don't even exist on the server. So obviously something is wrong with the curl command -- the redirect appears to be creating files without actually downloading the file on the server.

I don't know enough about Linux and the curl command to understand what might be wrong. I know this isn't a Linux forum, but any hints from techies who figured out this approach?
BrewerInTheAir, did you find a solution to your problem using this script? After a more careful review of what you were seeing, I now realize that you had exactly the same problem I am seeing. And it appears that the two of us may be the only ones that have tried this using Cygwin on Windows.

Has anyone for sure gotten this to work using Cygwin on Windows?
 
#30 ·
So I grabbed an extra old PC that I had on which I had loaded Linux Zorin 6.2 OS (a Windows-like Linux distribution; and yes, I'm one of the techies too, just not very well versed in Linux). I copied over the exact same script that I had tried in Cygwin on Windows 8.1, changing only the hash code in the cookies file to match the new one after I opened the browser on the Zorin system.

It still doesn't work. Same issue, except now the created "pdf" files are 0 file size, but still unreadable.

Something is wrong with this script, or I've introduced an error that I can't find. But Cygwin is not the problem -- it doesn't work in native Linux either.

Any help appreciated.
 
#31 ·
I found the problem, and the script is now working. It was a simple typo, but so subtle that it survived 4-5 proofreads. In my script, the URL path in the curl command line contained "$1" rather than "$i", although the redirect at the end correctly had "$i". Apparently the redirect at the end will create a blank file if the curl command cannot find the specified file on the server, so every pass through the do loop was looking for a file that didn't exist and then writing a correctly-indexed blank file into the directory. But since there is no redirect for error output, I didn't get any visible errors.

It's probably fairly easy to modify the script to redirect stderr to stdout so that if it didn't find a file it would output an error message, but I haven't taken time to figure that out yet.

The lesson is that you have to be VERY careful to avoid typos, especially in the curl command, because this script as written will silently crank out nicely indexed empty files that make it look like it's working when it isn't.
 
#33 ·
BTW if anyone successfully gets all 1,000+ files and needs help compiling them into a single .pdf file that can be navigated using the bookmark pane, I have Acrobat Pro and can help. I previously did this for my Impreza manual and it is pretty sweet. I'm good at that, put pretty poor at getting this Cywgin thing to work on my Win7 machine.
 
#34 ·
Just like that guy a few weeks ago I get an error that looks like I used notepad, but I actually am using a real text editor called Sublime Text, although I copied into the editor. I get this error at the top of the script:

/usr/bin/test.sh: line 5: syntax error near unexpected token `$'do\r''
'usr/bin/test.sh: line 5: `do

Even when I delete that and just re-type in the lines at the top the script will choke at the "do" line.

Any advice?
 
#35 ·
If I recall correctly (its been over a decade since I've used cygwin or windoze), it comes with the dos2unix command.

Just run (in cygwin) "dos2unix test.sh" and it should strip all of the dos junk out of the file.

Alternatively, there is a text editor for MS that is actually decent, called textpad. Google for it.
 
You have insufficient privileges to reply here.
Top