Using ncftp it is possible to do a complete ftp session from the UNIX shell, including sending your username and password and specifying which files to get. This is very useful if you want to automatically ftp some files every day, once a week or whatever. (See cron for more about scheduling events)
Finally, I had to install ncurses which I downloaded from the GNU archive at MIT (prep.ai.mit.edu) and then I discovered that the auto-configuration for ncftp-2.3.0 didn't work. I had to edit the Config.h file and manually comment out the line
Because I had curses.h, and not ncurses.h, but the configure program for some reason, deteremined that I should have the ncurses.h file./* Define if you have the
header file. */ /*#define HAVE_NCURSES_H 1*/
Now, suppose you have a bookmark called "Foo". Then you can do something like this.
ncftp Foo:/dir/fileAnd ncftp should log you in, and get the file /dir/file and leave it in the current directory. For other options, read the ncftp man pages.
Because that option didn't work at the site I was trying, I had to come up with another method.
macro .open.Foo cd dir get file endSession end macro endSession close quit end
The first macro references a bookmark I made called Foo. The .open.Foo macro will be called automatically whenever ncftp connects to the server I named in the Foo bookmark. So the first thing the macro does is to cd to directory "dir" and then it gets file "file" and then it calls the macro "endSession"
The endSession macro simply closes the connection and forces ncftp to quit, thus returning to the shell which started this whole thing.
To use this method, from the command line simply say "ncftp Foo"
Return to Gene's Home Page
Return to Gene's Random Unix Crap