From owner-freebsd-questions@FreeBSD.ORG Wed Oct 10 21:46:18 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 4668216A46D for ; Wed, 10 Oct 2007 21:46:18 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id D623513C4A8 for ; Wed, 10 Oct 2007 21:46:17 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.13.8) with ESMTP id l9ALk548005252; Wed, 10 Oct 2007 16:46:05 -0500 (CDT) (envelope-from derek@computinginnovations.com) Message-Id: <6.0.0.22.2.20071010164447.0253f6f0@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Wed, 10 Oct 2007 16:45:39 -0500 To: White Hat , FreeBSD Users Questions From: Derek Ragona In-Reply-To: <201915.39444.qm@web34405.mail.mud.yahoo.com> References: <201915.39444.qm@web34405.mail.mud.yahoo.com> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: 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:46:18 -0000 At 04:31 PM 10/10/2007, White Hat wrote: >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. try set -x and see what the output looks like. I'd guess you are not escaping the $ right in your script. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.