Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Terminal001

macrumors newbie
Original poster
Dec 23, 2010
2
0
Hello everyone!

Is there a way to upload files to an FTP server with a single-line command?
Something like:
ftp login:pass@localhost mput "files" ?
Without having to connect first, and then execute mput.

Thank you!
 
I haven't had to do this, but from the manpage it looks like you can setup an entry in your .netrc file with login information and a macro definition called init. This will result in auto-login and running of the macro when you run:
ftp servername

Check out the ftp man page, and play with this. You might need the -i option to allow an unprompted mput.

-Lee
 
Thanks a lot guys! Both solutions are really clever, but I guess the use of Curl would be more elegant. Love the macro-script idea though!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.