Error when running script

Hi All,

Need your guuys help here.

#!/bin/bash
{
echo "POLICY LIST"
echo "===================================="

bppllist

echo "   "

echo "POLICY DETAILS"
echo "===================================="
for type in daily weekly monthly quarterly
echo "===================================="
echo "POLICY FOR " $type
echo "===================================="
for policy in `bppllist |grep $type`
do
bppllist $policy -U
done
} |tee -a backup_report.`date '+%Y%m%d.%H%M'`.log

I encountered an error when running this script.

./backup_config_report.sh: line 13: syntax error near unexpected token `echo'
./backup_config_report.sh: line 13: `echo "===================================="'

Any idea?

rgds,

why does the first for loop does not have the constructs do and done as like the second for loop ?

for type in daily weekly monthly quarterly
do
echo "===================================="

Added, but i encountered this error.

./backup_config_report.sh: line 21: syntax error near unexpected token `}'
./backup_config_report.sh: line 21: `} |tee -a backup_report.`date '+%Y%m%d.%H%M'`.log'

do you added done ?

Show us the full script.

#!/bin/bash
{
echo "POLICY LIST"
echo "===================================="

bppllist

echo "   "

echo "POLICY DETAILS"
echo "===================================="
for type in daily weekly monthly quarterly
echo "===================================="
echo "POLICY FOR " $type
echo "===================================="
for policy in `bppllist |grep $type`
do
bppllist $policy -U
done
} |tee -a backup_report.`date '+%Y%m%d.%H%M'`.log

Kindly do your homework right, before getting back again.

You have not added do and done for the outer for loop.

err...sorry.
i paste the old script.
i have added the do, now where do i need to add done?

---------- Post updated at 07:59 PM ---------- Previous update was at 07:56 PM ----------

ahh...nvm.
i figured it out. Thanks.