The default sftp program Linux (at least Ubuntu) uses is written with security in mind, instead of the user’s wishes. Stating that “writing your password into a script is insecure” (which it obviously is, I fully agree!), they restrict the password input to the terminal, and somehow the smart-ass programmers managed to find the terminal even when all standard I/O (stdin, stdout, stderr) are passed through pipes.
Obviously, this is a pain in the ass if you want to upload stuff to Sourceforge automatically, as the only solution for automated logins is to use ssh key files. Uploading ssh keys to Sourceforge, however, is not possible, thus, I strived for another program providing better functionality.
Being an ex-Windows-user, PuTTY promptly came to mind.
nice functionality: it is able to read the password as a parameter and
even hides it in the process list output (I guess it must have forked to
achieve that). Now, the familiar unix style known from automating ftp
sessions can be used to script it:
psftp firstname.lastname@example.org -pw password <<EOF cd /some/folder put some.file exit EOF