From owner-freebsd-questions@FreeBSD.ORG Wed Feb 1 00:33:16 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 365A016A420 for ; Wed, 1 Feb 2006 00:33:16 +0000 (GMT) (envelope-from unixgeek@six-two.net) Received: from imf22aec.mail.bellsouth.net (imf22aec.mail.bellsouth.net [205.152.59.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D40E43D46 for ; Wed, 1 Feb 2006 00:33:15 +0000 (GMT) (envelope-from unixgeek@six-two.net) Received: from ibm65aec.bellsouth.net ([65.7.234.118]) by imf22aec.mail.bellsouth.net with ESMTP id <20060201003311.OOXZ5922.imf22aec.mail.bellsouth.net@ibm65aec.bellsouth.net> for ; Tue, 31 Jan 2006 19:33:11 -0500 Received: from [192.168.1.102] (really [65.7.234.118]) by ibm65aec.bellsouth.net with ESMTP id <20060201003304.GLGO516.ibm65aec.bellsouth.net@[192.168.1.102]>; Tue, 31 Jan 2006 19:33:04 -0500 In-Reply-To: <20060130034503.80452.qmail@web37106.mail.mud.yahoo.com> References: <20060130034503.80452.qmail@web37106.mail.mud.yahoo.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <53561486-0243-47EC-961C-BE4B823CCBA1@six-two.net> Content-Transfer-Encoding: 7bit From: Gunter Wambaugh Date: Tue, 31 Jan 2006 18:31:44 -0600 To: Angelo Christou X-Mailer: Apple Mail (2.746.2) Cc: freebsd-questions@freebsd.org Subject: Re: FTP Automate Shell Script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 00:33:16 -0000 I have a ftp script that copies files from a solaris box to an as400. Maybe it will work on FreeBSD. (?) nsaFtp.sh: ftp -in < nsaFtpCmds Joppa 21 nsaFtpCmds: user USERNAME PASSWORD cd /QDLS/MM4R5FLR/00500 lcd data mput SYB* dir quit On Jan 29, 2006, at 9:45 PM, Angelo Christou wrote: > Hello. I am using FreeBSD 6.0 and Bash as my shell. I > am following a tutorial to create a shell script to > copy some files. It works perectly exept for 2 points. > > Here is the article - > > http://www.quepublishing.com/articles/printerfriendly.asp?p=170517 > > Here is the script - > > #!/bin/sh > > temp="/tmp/$(basename $0).$$" ; trap "/bin/rm -f > $temp" 0 > targetdir="remote-dir" > remote="laptop.intuitive.com" > > echo "taylor" > $temp > echo "cd $targetdir" >> $temp > > for file in * > do > if [ -f $file ] ; then > echo "put $file $file" >> $temp > else > echo "skipping $file: not a file." >&2 > fi > done > > echo "quit" >> $temp > > ftp $remote < $temp > > exit 0 > > One problem is that the password must be entered > manually, I have spent a good part of the day > experimenting but can't seem to automate this. Can the > password be entered using the script? > > The other problem is that it copies the actual file. > What command would I look at to copy only images > (.jpg) for example? > > Thanks in advance. > Ang. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions- > unsubscribe@freebsd.org"