#!/bin/sh ################################################## # Author: pao # Date: Nov 25 2008 # # Script to automate anonymous ftp login, upload & download to # anonymous qad ftp site # # Usage: # # $0 file # # Possible Extentions & Limitations: # 1. Currently script copies/uploads one file # 2. Can easily be altered to execute mputs/mgets etc. # - just edit the "END_FTP_SCRIPT" here-doucment or add an "if" ################################################## NO_ARGS=2 # Check for valid number of arguments if [ $# -ne "$NO_ARGS" ] then echo " Usage: Requires 2 arguments: $0 file " exit; fi #script #Define Constants First HOST='ftp.qad.com' USER='anonymous' PASSWD='ftp@qad.com' #The 2 input assignments: #Run the "command" in ftp on the "file" specified COMMAND=$1 FILE=$2 # #This connects to ftp and executes the command ftp -n $HOST <