A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Automate an FTP script

in the ftp script put.pl:
#!/bin/bash
HOST="example.com"
HOMEDIR="/"
ftp -i $HOST <<-EOF
passive
cd $HOMEDIR
put $1
quit
EOF
echo "I put the file "$1

in ~/.netrc:

machine example.com
    login [username]
    password [password]

to run:
put.pl [filename]