[KLUG Members] help with bash script error
Dan DeSloover
zifferent at yahoo.com
Mon Sep 12 10:49:49 EDT 2005
A wild guess:
I could be wrong and often am, but might it be the semicolon?
--- Richard Harding <rick at ricksweb.info> wrote:
> I'm trying to setup this code that will merge mailgraph with cacti for
> postfix for me and I've gotten so close (his setup was FreeBSD and I'm
> on debian), but I have one error I can't figure out.
>
> I'm not a bash master, but it seems like this should work from the
> documentation on loops I can see online.
>
> The script is:
>
> #!/bin/bash
> for i in sent received rejected bounced spam virus;
> do
> c=$(/bin/cat /var/tmp/mail$i)
> result="${result} ${i}:${c}"
> echo 0 > /var/tmp/mail$i
> done
> echo $result
>
> I'm getting the error:
> 'ostfixstats.sh: line 2: syntax error near unexpected token `
> 'ostfixstats.sh: line 2: `for i in sent received rejected bounced spam
> virus;
>
> Am I missing something on how the for loop should look?
>
> Thanks for any help.
>
> Rick
>
> _______________________________________________
> Members mailing list
> Members at kalamazoolinux.org
>
>
Thanks,
Dan DeSloover
zifferent at yahoo.com
More information about the Members
mailing list