Using Expect and Cadaver to automate WebDAV uploads (w\ example script)

February 13th, 2009

... or the one about how I finally got around to learning expect.

DISCLAIMER: I still hate windows.

I spent a decent portion of today hunting around for a way to script or otherwise automate (at the command line) uploading a file to one of $wageslavery’s external vendors. After diddling with curl -T only to find that it only works if the destination file doesn’t exist, I finally bit the bullet and installed Cygwin. Cygwin provides a win32 version of expect, the command line automation tool and cadaver, the command line WebDAV utility, basically smbclient for WebDAV. Working example code after the break!
Read the rest of this entry »