From owner-freebsd-questions@FreeBSD.ORG Mon Jan 30 03:45:04 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 EE28716A420 for ; Mon, 30 Jan 2006 03:45:04 +0000 (GMT) (envelope-from christou44@yahoo.com) Received: from web37106.mail.mud.yahoo.com (web37106.mail.mud.yahoo.com [209.191.85.108]) by mx1.FreeBSD.org (Postfix) with SMTP id 52EF744518 for ; Mon, 30 Jan 2006 03:45:04 +0000 (GMT) (envelope-from christou44@yahoo.com) Received: (qmail 80455 invoked by uid 60001); 30 Jan 2006 03:45:03 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=iY4v5sgutZWZXQ4e+khshLIUZi5G9XtZMvhjA1xRrWHhv+tQ5gDAdZM2QTEYelvJ6zmvwVTgh89FLIP5TUYNEs3ulbIMSBIx7D3NAFVQUI7fZshuAI8wCwRokiXRaUuT/3W9HlaSbpf2e2RfeaA46MZP6G0zJ8nzSiUzV+FUgIU= ; Message-ID: <20060130034503.80452.qmail@web37106.mail.mud.yahoo.com> Received: from [61.95.65.37] by web37106.mail.mud.yahoo.com via HTTP; Sun, 29 Jan 2006 19:45:03 PST Date: Sun, 29 Jan 2006 19:45:03 -0800 (PST) From: Angelo Christou To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: 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:45:05 -0000 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