From owner-freebsd-questions@FreeBSD.ORG Thu Oct 21 18:35:11 2004 Return-Path: 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 CC64B16A4CF for ; Thu, 21 Oct 2004 18:35:11 +0000 (GMT) Received: from ion.franksworld.org (vhost.domainatlantic.com [67.18.185.244]) by mx1.FreeBSD.org (Postfix) with ESMTP id 769C043D1D for ; Thu, 21 Oct 2004 18:35:11 +0000 (GMT) (envelope-from laszlof@vonostingroup.com) Received: (qmail 59236 invoked by uid 98); 21 Oct 2004 13:37:55 -0000 Received: from laszlof@vonostingroup.com by ion.franksworld.org by uid 89 with qmail-scanner-1.20 (clamdscan: 0.75.1. Clear:RC:0(68.72.248.38):SA:0(?/?):. Processed in 3.07545 secs); 21 Oct 2004 13:37:55 -0000 X-Spam-Status: No, hits=? required=? Received: from unknown (HELO vonostingroup.com) (frank@cpmsg.com@68.72.248.38) by vhost.domainatlantic.com with SMTP; 21 Oct 2004 13:37:52 -0000 Message-ID: <4178015B.3080307@vonostingroup.com> Date: Thu, 21 Oct 2004 14:35:07 -0400 From: Frank Laszlo User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Kevin D. Kinsey, DaleCo, S.P." References: <4177D424.3040702@daleco.biz> In-Reply-To: <4177D424.3040702@daleco.biz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Danny cc: FreeBSD-questions Subject: Re: OT: date command for pflogsumm.pl Script - undefined variable X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2004 18:35:11 -0000 Kevin D. Kinsey, DaleCo, S.P. wrote: > Danny wrote: > >> I am trying to get this script to run: >> >> # >> day=`/bin/date "+%m-%d-%Y"` >> # >> /usr/sbin/pflogsumm.pl -i -mailq --smtpd_stats --problems_first >> --iso_date_time -d yesterday /home/user/maillog > >> /var/log/MX1-PostfixDailyReport.${day} >> # >> gzip -c /var/log/MX1-PostfixDailyReport.${day} | uuencode >> MX1-PostfixDailyReport.${day}.gz | mail -s "`hostname` Daily Mail >> Report for `LC_CTIME=C date +\"%A, %d %B %Y\"`" root # gzip >> /var/log/GW1-PostfixDailyReport.${day} >> # >> and I know very little about programming (I am working on this), and I >> receive the following error: >> >> mx1# ./pflogsumm.test >> day=10-21-2004: Command not found. >> day: Undefined variable. >> day: Undefined variable. >> >> Any suggestions? I just want this script to run and email me the >> output of pflogsumm.pl for my maillogs. >> >> Thank you! >> >> ...D >> > > Which shell are you using? Sounds like *NOT* /bin/sh. try adding: #!/bin/sh to the top of the script. Regards, Frank