Where did wget command go?

simple

Registered
Hi all, this is my first mac. I've never used OSX or freeBSD, which is what I'm told its based on. I have used linux and there was a command called wget, which I cannot find on my mac. I thought it would be here since this is still unix. I'm trying to run a shell script called bashpodder and it calls for the wget command, but all I get is an error stating that there is no such command. Do I have to installed the developer package to get this or something?


Thanks all
 

chornbe

Who, me?
You can install it from a host of sites, or simply use the CURL command


Code:
curl [url]http://www.yahoo.com[/url] > yahoo_com.html
curl [url]ftp://user:pwd@site.com/dir/dir/file.txt[/url] > ~/file.txt
Curl is slightly different in that it sends downloaded data to stdout by default, but you can redirect it (as above) or check its various and plentiful command line switches for local file creation, piping, etc. It's a very sweet utility.
 

spb

Registered
If you're familiar with the linux tool apt-get you can also use this to install software.

sudo apt-get install wget

Also make certain that your path includes the /sw/bin/ directory, which is where wget and all of the useful software is stored after being installed.
 

spb

Registered
chornbe said:
isn't that installed with Fink and, thus, not part of the base Apple OS/X installation?
Yes, you're right, I think.

I guess I'm assuming that simple is a UNIX/Linux user so he's already installed fink and the XCode tools. If he doesn't have this installed we'd get a comment back about, "I can't find apt-get" :7)
 

scruffy

Notorious Olive Counter
curl with the -O flag (capital o, not zero) flag will save the file to disk rather than sending it to stdout.
 

scruffy

Notorious Olive Counter
The one thing, for my purposes, that curl lacks, is the ability to parse html itself. wget can download an html page, parse it for links, and recurse down those links - allowing you to spider a whole website looking for broken links, or download a complete web page with all necessary stylesheets, images, external scripts, frame contents, etc. It will even rewrite the links in the documents in the downloaded documents to point to the on-disk copies.
 
Top