-
 

WGet is wonderful.
 

1) There is a very small bug in WGet version 1.8.1. The bug occurs when a .wgetrc file is edited using an MS-DOS text editor:

WGet returns an error message when the .wgetrc file is terminated with an MS-DOS end-of-file mark (Control-Z). MS-DOS is the command-line language for all versions of Windows, so ignoring the end-of-file mark would make sense.
 

2) Suggested changes to two places in the manual are given below (the changes are in italic). These changes will help not only people who normally use Windows, but also people who normally use Unix, are not familiar with Windows, and are trying to install WGet under Windows.
 

Regards,

Michael Jennings
 

_____________________
 
 

Invoking

By default, Wget is very simple to invoke. The basic syntax is:

wget [option]... [URL]...

(Users of the Microsoft Windows version should see the explanation under the startup file section below.)
 

_____________________
 
 

Startup File

Once you know how to change default settings of Wget through command line arguments, you may wish to make some of those settings permanent. You can do that in a convenient way by creating the Wget startup file--.wgetrc.

Besides .wgetrc is the "main" initialization file, it is convenient to have a special facility for storing passwords. Thus Wget reads and interprets the contents of $HOME/.netrc, if it finds it. You can find .netrc format in your system manuals.

Wget reads .wgetrc upon startup, recognizing a limited set of commands.

Microsoft Windows version: Users of the Microsoft Windows version can call the .wgetrc file wgetrc.txt.

In the 1.8.1 version of WGet, an MS-DOS end-of-file character at the end of the .wgetrc (or wgetrc.txt) parameters file will cause an error message. You will have this character if you edited the sample .wgetrc file with an MS-DOS text editor.

There are two ways to deal with this: 1) Ignore the error. 2) Remove the end-of-file character by editing the wgetrc.txt file with a Windows editor and deleting the rectangle representation of the end-of-file character at the very end of the file.

Here is the contents of an example WGetB.BAT file for use in starting WGet under Windows. This example assumes that the sample .wgetrc file has been copied to wgetrc.txt:

set WGETRC=C:\Program Files\WGET\V181 WIN\wgetrc.txt
"C:\Program Files\WGet\v181 Win\wget.exe" -rKkpv -l1 -o wget.log %1 %2 %3 %4

The SET command sets the WGETRC environment variable to the path and name of the .wgetrc parameters file, now called wgetrc.txt. Environment variables accept embedded spaces; it is not necessary or possible to use quotes. WGet will get its parameters from the wgetrc.txt file, as well as from the command line. (The command line parameters override the parameters in the wgetrc.txt file.)

The second line of the WGetB.BAT file starts WGet operation. The quote marks are necessary only if you have a space in the path or file name. Quotes can always be used even if there are no spaces.

Change the above lines so that they are suitable for your folders and parameters. Microsoft Windows paths and file names are not sensitive to the case of the letters.

Note that the sample batch file above is not called wget.bat because of the possibility that the Windows operating system would confuse the batch file and the wget.exe executable file.

Use
wgetb -l3 site.com <ENTER>
to download 3 levels of the website, site.com.
 

_____________________
 
 
 

Reply via email to