From owner-freebsd-questions@FreeBSD.ORG Mon Jan 30 03:56:05 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 7228116A420 for ; Mon, 30 Jan 2006 03:56:05 +0000 (GMT) (envelope-from ggcameron@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8FF04450B for ; Mon, 30 Jan 2006 03:56:04 +0000 (GMT) (envelope-from ggcameron@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so651320wxc for ; Sun, 29 Jan 2006 19:56:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=B5UwSKlhI8O9aUeNhBRAgSizA0NBNXFjNxe57Gh0IEHG1QobEY0StbTx8zBltQcxnwj8fwpXVUo1MXC8xi0GLUSuug2MLBh1ED+o3aPljav7ohXUTd5/5I3h5eW8dM5y7qIwUvUbGLQdVb37EvulxgaUPdip5pYeFuMtUkcoolU= Received: by 10.70.17.13 with SMTP id 13mr6512930wxq; Sun, 29 Jan 2006 19:56:04 -0800 (PST) Received: by 10.70.20.8 with HTTP; Sun, 29 Jan 2006 19:56:04 -0800 (PST) Message-ID: <1efd1aec0601291956h1ff6b369i5b215380908fb141@mail.gmail.com> Date: Mon, 30 Jan 2006 14:56:04 +1100 From: Gavin Cameron To: Angelo Christou In-Reply-To: <20060130034503.80452.qmail@web37106.mail.mud.yahoo.com> MIME-Version: 1.0 References: <20060130034503.80452.qmail@web37106.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Mon, 30 Jan 2006 03:56:05 -0000 A .netrc file (read the ftp man page) may work for you. Cheers Gavin On 1/30/06, 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=3D170517 > > Here is the script - > > #!/bin/sh > > temp=3D"/tmp/$(basename $0).$$" ; trap "/bin/rm -f > $temp" 0 > targetdir=3D"remote-dir" > remote=3D"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" >