Error when running script


 
Thread Tools Search this Thread
Operating Systems Solaris Error when running script
# 1  
Old 12-29-2009
Error when running script

Hi All,

Need your guuys help here.
Code:
#!/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.
Code:
./backup_config_report.sh: line 13: syntax error near unexpected token `echo'
./backup_config_report.sh: line 13: `echo "===================================="'

Any idea?

rgds,

Last edited by Scott; 01-04-2010 at 02:58 AM.. Reason: code tags
# 2  
Old 12-29-2009
why does the first for loop does not have the constructs do and done as like the second for loop ?

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

# 3  
Old 12-29-2009
Added, but i encountered this error.
Code:
./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'


Last edited by Scott; 01-04-2010 at 02:59 AM.. Reason: code tags
# 4  
Old 12-29-2009
do you added done ?

Show us the full script.
# 5  
Old 12-29-2009
Code:
#!/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


Last edited by Scott; 01-04-2010 at 02:59 AM.. Reason: code tags
# 6  
Old 12-29-2009
Kindly do your homework right, before getting back again.

You have not added do and done for the outer for loop.
# 7  
Old 12-29-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error running script

Hi, I have the the below script more runcda.sh if *\).*/\1/p' $1_dr) ]; then echo "ParallelGCThreads Found with Value" else echo "ParallelGCThreads Not Found - Add !!" fi $ ./runcda.sh output.log ./runcda.sh: test: argument expected ParallelGCThreads Not Found - Add !! Why am i... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Error in running DB query by script

Hi I was trying to fetch data from database. But the number of rows exported were huge so i got the error. Experts please advice. Thanks a lot for your supprt. #: ./script.sh ./script.sh: xmalloc: subst.c:3076: cannot allocate 1401346369 bytes (0 bytes allocated) (2 Replies)
Discussion started by: brij123
2 Replies

3. Shell Programming and Scripting

Error when running script in background

Hi guys, ./test.sh & #!/usr/bin/ksh echo "No.Of Items :" read count echo "Report Time (Min):" read time some other command .... exit 0; thanks (3 Replies)
Discussion started by: asavaliya
3 Replies

4. Shell Programming and Scripting

Error while running script using nohup

Hi, I am running the below script. When i run the script normally it executes fine but when i run the same script using nohup it throws an error as getStatus.sh: syntax error at line 3: `(' unexpected . Can you let me know why it is so? while do . $(dirname $0)/include.sh cd... (2 Replies)
Discussion started by: vignesh53
2 Replies

5. UNIX and Linux Applications

Getting error code when running the script 2 (RC)2

hi All, we have a script to remove the files from particular path,when we tryingto run manually the script went to success and removed the files but the same script which is running by other team it got failed and giving the error "2 (RC)2 "..what is the cause of the failure..and we passing the... (2 Replies)
Discussion started by: nagavenkatesh
2 Replies

6. Shell Programming and Scripting

Error running nawk script

Hi, I was trying to use nawk script given in this link https://www.unix.com/aix/19979-df-output-not-aligned.html but when i do this im getting this error $ df -k|formatDF.nawk -ksh: formatDF.nawk: not found Can anyone help me on this... (6 Replies)
Discussion started by: niteesh_!7
6 Replies

7. UNIX for Dummies Questions & Answers

Getting error when running script through crontab

Hi all, I wrote small script for Solaris and when I am running it through command prompt its ok, but when I trying to run it using crontab, i am getting error like: ld.so.1: dbloader: fatal: libACE.so: open failed: No such file or directory /tmp/file.sh: line 5: 8304 Killed ... (4 Replies)
Discussion started by: nypreH
4 Replies

8. Shell Programming and Scripting

error in in running script

Hi all, I have created a script file .sh and had some allias commands, local variable, some grep features, and listing files/directories, and it worked correctly and I got the outputs I am looking for after I run the script . However, some of the grep commands and some other functions did not... (2 Replies)
Discussion started by: aama100
2 Replies

9. Shell Programming and Scripting

Error while running your script -- Balamv

When I run this, I am getting the below error. Why? Pls help me #!/bin/ksh echo Hello World dirs="not_using_0" for entry in *; do && dirs="$dirs $entry" done dirarray=($dirs) index=1 while }" ] ; do echo "${index}: ${dirarray}" index=`expr $index + 1` done while ; do echo -n... (1 Reply)
Discussion started by: balamv
1 Replies

10. UNIX for Dummies Questions & Answers

Error while running a script

Hi all, By running a (command) script I'm getting the following error: .: /usr/bin/test: cannot execute binary file This is the command: $ . test The script (test) is very simple sqlplus user/password @1.sql sqlplus user/password @2.sql Can enyone tell me what the problem is. (5 Replies)
Discussion started by: HarryTellegen
5 Replies
Login or Register to Ask a Question