#!/bin/sh
HOST='ftp.mistonline.in'
USER=''
PASSWD=''
FILE='file.txt'
ftp -n $HOST << END
quote USER $USER
quote PASS $PASSWDcd databackup/DB/
put $FILE
quit
END
exit 0
The Tricks
Getting the password to the ftp server without having the ftp client program read the password from /dev/tty requires two tricks:
- Using the -n option on the ftp client program to prevent the ftp client from trying to log in immediately. That way, the ftp client does not ask for a user ID and password. No use of /dev/tty.
- Use the ftp client program command quote to send user ID and password to the ftp server.
- The file /dev/tty is a character file with major number 5 and minor number 0, usually of mode 0666 and owner.group root.tty.
- /dev/tty helps output displayed to the (terminal)
Incoming search terms:
- javascript ftp example (6)
- shell script to ftp files from one server to another (6)
- ftp shell tutorial (5)
- ftp files from one server to another using shell script (4)
- ftp shell script size (4)
- shell script to ftp from desktop (3)
- how to find javascript keycode for double quote? (3)
- ftp shell php (2)
- shell check file size ftp (2)
- jquery filestyle ie7 (2)
- jquery mobile pass parameters to popup (2)
- javascript keycode of double quote (2)
- javascript keycode double quotes (2)
- blob mediumblob mysql symfony2 (2)
- sample shell script to ftp files from one server to another (2)
- tuto ftp shell (2)
- shell script to ftp a file from one server to another (2)
- searching 1 2 3 days file ftp shell scripting (1)
- shel script ftp a file then to mysql blob (1)
- shell script ftp upload check file size (1)
- shell script ftp validate file size (1)
- shell desktop file in ftp (1)
- shell script ftp original file size (1)
- shell script ftp files one server another (1)
- shell desktop for ftp (1)
- Shell script for password expire alert (1)
- shell script for ftp server (1)
- shell script for ftp file from one server to another (1)
- shell script for file desktop to linux server (1)
- shell ftp upload (1)
- shell FTP size (1)
- shell script how to check file size at ftp location (1)
- shell script submit password (1)
- simple shell script for ftp connection (1)
- simple unix shell scripts mysql file (1)
- size ftp shell script (1)
- unix ftp check file size (1)
- unix ftp shell -i (1)
- unix shell check ftp file size (1)
- unix shell script to ftp a file from your desktop (1)

