Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Oct 2004 14:35:07 -0400
From:      Frank Laszlo <laszlof@vonostingroup.com>
To:        "Kevin D. Kinsey, DaleCo, S.P." <kdk@daleco.biz>
Cc:        FreeBSD-questions <questions@freebsd.org>
Subject:   Re: OT: date command for pflogsumm.pl Script - undefined variable
Message-ID:  <4178015B.3080307@vonostingroup.com>
In-Reply-To: <4177D424.3040702@daleco.biz>
References:  <addc34c604102107571d7f915e@mail.gmail.com> <4177D424.3040702@daleco.biz>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4178015B.3080307>