From owner-freebsd-questions@FreeBSD.ORG Wed Oct 10 21:31:58 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B834816A67E for ; Wed, 10 Oct 2007 21:31:58 +0000 (UTC) (envelope-from pigskin_referee@yahoo.com) Received: from web34405.mail.mud.yahoo.com (web34405.mail.mud.yahoo.com [66.163.178.154]) by mx1.freebsd.org (Postfix) with SMTP id 5D92413C4AC for ; Wed, 10 Oct 2007 21:31:57 +0000 (UTC) (envelope-from pigskin_referee@yahoo.com) Received: (qmail 39585 invoked by uid 60001); 10 Oct 2007 21:31:57 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=JD93OV14sSn6NCJm2EQ3laAoi+D0A0tYFWjUtwrHp1+qN5KTMMb9U8+jtWLjGQKygRhh2g3lilHPveC9cRd/Jb76LxHBStxgTRu1HQ1K28nIZw1Re//aJKSQdVTa68fKNKuii4I2e7Jaxe5rRXaTvjGh1rf2QyzM2CIzLnxBkSE=; X-YMail-OSG: YcAt.BgVM1kHky2647VPQJv_r3_Q9j_yVI7We0lgKcQ8VDRvlQpoM8K.YhHapGepWUTcBrSms9tMvaiUJmXGRae7G2eTZD4Da3j7F9URRj.DjEkz4ns- Received: from [67.189.206.211] by web34405.mail.mud.yahoo.com via HTTP; Wed, 10 Oct 2007 14:31:56 PDT Date: Wed, 10 Oct 2007 14:31:56 -0700 (PDT) From: White Hat To: FreeBSD Users Questions MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <201915.39444.qm@web34405.mail.mud.yahoo.com> Subject: FTP & CRON 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, 10 Oct 2007 21:31:58 -0000 This is driving me crazy. I have a small script that I run from CRON. It is run as a regular user and not as ROOT, although I have tried it both ways. It uploads SPAM to the 'knujon.com' site'. I have created a ~/.netrc file that looks like this: machine knujon.com login user password secret macdef spam put $1 quit Now, if I run the following command from the command prompt, the script works fine. echo \$ spam spam.zip | ftp -n ftp://user:secret@knujon.com The above should all be on one line, although it may be shown split into two right now. However, if this is put into a bash script, and run if from CRON, I receive a mail with this error message: 'spam' macro not found. I have no idea what I am doing wrong. I have the $HOME, $SHELL and $PATH variables set in CRON. -- White Hat pigskin_referee@yahoo.com ____________________________________________________________________________________ Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/