< Buzzing or vibrating the login form using jquery Posted On May 15, 2012 : 0 comments << >> Simple div slideshow using jquery Posted On May 9, 2012 : 0 comments << >> Copy mysql column in varchar to type date Posted On May 3, 2012 : 0 comments << >> Enter only numbers inside a input field of a form using javascript Posted On May 1, 2012 : 0 comments << >> Slide in and out animate div vertically using jquery Posted On April 25, 2012 : 1 comment << >> Tag cloud using php, mysql and ajax with filter Posted On April 24, 2012 : 0 comments << >> Change webpage font color or background color from the user side using javascript Posted On April 19, 2012 : 0 comments << >> A single link that cycles through several webpage background color using javascript Posted On April 17, 2012 : 0 comments << >> Simple webpage redirection using perl script Posted On April 10, 2012 : 0 comments << >> Get ipaddress using perl script Posted On April 4, 2012 : 0 comments << >>

Simple shell script to FTP file from your Desktop to FTP server

This Tutorial Has Been Viewed 3,048 Times.
VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)


#!/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:

  1. 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.
  2. Use the ftp client program command quote to send user ID and password to the ftp server.
  3. 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.
  4. /dev/tty helps output displayed to the  (terminal)
VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)

Incoming search terms:

Leave a Reply

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks