Urgent: Script.sh: syntax error at line 72: `PROGRESS=$' unexpected


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Urgent: Script.sh: syntax error at line 72: `PROGRESS=$' unexpected
# 8  
Old 05-05-2009
There is a typing error in the first line:

Quote:
# !/bin/bash
The space after the # will cause the change of shell to be ignored.
Try.

Code:
#!/bin/bash

# 9  
Old 05-05-2009
There is a space in your shebang line.
# 10  
Old 05-06-2009
MySQL

Perfect. That fixed it. I was always manually running the script in bash, thats why I was not getting the error. Removed the space and it works like a charm.

Thanks All. For quickly resolving this.Smilie
# 11  
Old 05-06-2009
One more quick question.

In the Logs when I echo PROGRESS. The value is as below.

?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command
?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command ?Invalid command
Connected to XX.XX.XX.XX(vsFTPd 2.0.3) 331 Please specify the password. 230 Login successful. 200 PORT command successful. Consider using PASV. 150 Ok to send data. 226 File receive OK. local: File.txt remote: File.txt 14352 bytes sent in 0.086 seconds (162.20 Kbytes/s) 221 Goodbye.

Why is it showing ?Invalid command. The FTP is working fine. But Logs are not good.
# 12  
Old 05-06-2009
There is a major logic error in the script in this area:

Quote:
echo "open X.XX.XXX.XX" >> $PROS_LOAD_LOG
echo "user uname pass" >> $PROS_LOAD_LOG
echo "put $FILENAME" >> $PROS_LOAD_LOG
echo "bye" >> $PROS_LOAD_LOG

PROGRESS=$(/bin/ftp -vin < $PROS_LOAD_LOG 2>&1)
Earlier in the script many text lines are appended to $PROS_LOAD_LOG and then a few ftp commands are appended on the end of this file. The whole content of the file ${PROS_LOAD_LOG} is then given to ftp to process - hence the error messages! You need to separate the ftp input commands from the output log.
# 13  
Old 05-07-2009
I thoguht I could use the same file. I changed it to a new file and it works fine. Thanks methyl for resolving that. This is a Great Forum.
# 14  
Old 05-07-2009
Your'e welcome
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cannot execute/finish script because of last line syntax error: unexpected end of file/token `done'

first of all I thought the argument DONE is necessary for all scripts that have or begin with do statements which I have on my script, However, I still don't completely understand why I am receiving an error I tried adding another done argument statement but didn't do any good. I appreciate... (3 Replies)
Discussion started by: wolf@=NK
3 Replies

2. Shell Programming and Scripting

Syntax error at line 24: `(' unexpected

Hi, I am getting an wired error.... the script is running fine when i run it manually... but the same when i try to run in nohup mode, i am getting error if Error: syntax error at line 24: `(' unexpected The above if is the 24th line!!! I dont understand the error... (4 Replies)
Discussion started by: Nithz
4 Replies

3. Shell Programming and Scripting

Syntax error at line 14: `gw_user=' unexpected

Masters, i iam writing a script (dont have much experience in the process of learning) which handles file copy to multiple servers and users for deployment purpose. Below is the snippet. When ever i run i get syntax error but it works fine on another machine. Please help me out. if then... (10 Replies)
Discussion started by: ameyrk
10 Replies

4. Shell Programming and Scripting

Urgent:- syntax error near unexpected token `done'

hi, i need to with making while loop logic working in shell program, i got syntax error the following Code and Error details: x=60 while do /usr/bin/php /home/egrdemo/public_html/pposh_new/cron-set.php x=$((x-1)) sleep 1 done ... (5 Replies)
Discussion started by: kannankrp
5 Replies

5. UNIX for Dummies Questions & Answers

syntax error at line 8: `(' unexpected

Hi I am having a shell script load_data.sh which calls /home/users/project/.profile. When am executing the script, am getting below error: $sh -x bin/load_data.sh null + . /home/users/project/.profile bin/load_data.sh: syntax error at line 8: `(' unexpected The line which is throwing... (1 Reply)
Discussion started by: brijesh.dixit
1 Replies

6. Shell Programming and Scripting

Help on shell script : syntax error at line 62: `end of file' unexpected

Hi All, I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected". I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies

7. Shell Programming and Scripting

syntax error at line 28: `(' unexpected

hi can anyone pls look into this....shell script... Pls find the error below: > sh -n tmp tmp: syntax error at line 28: `(' unexpected isql -Usa -S$1 -P`grep $1 dbpassword|cut -d ":" -f3` -w2000 -b<<! set nocount on declare @i int declare @dbname char(6) declare @tmp int if... (10 Replies)
Discussion started by: rajashekar.y
10 Replies

8. UNIX Desktop Questions & Answers

line 3: syntax error near unexpected token `('

Hi All I've used UNIX in the past experimenting with commands through terminal but thats about it. Im now currently teaching myself "C". Using a book from the library, the first chapter asks you run and compile your program from a command-line prompt. As you will see the program is very simple,... (4 Replies)
Discussion started by: camzio
4 Replies

9. UNIX for Dummies Questions & Answers

syntax error at line 33: `elif` unexpected

#!/bin/sh echo "Choose option: e, d, l, t, p, or x." read option if test $option = e then echo "Filename?" read file if test ! -f $file then echo "No such file" else echo "Yes its a file" fi ... (4 Replies)
Discussion started by: hazy
4 Replies

10. Programming

sh: syntax error at line 1: `>' unexpected

I compiled C program under SUN OS sparcv9 ...I had a problem related to SIGBUS which has been resolved by adding an option to the CC compiler which is memory alignement option ..-memalign=1i as I remmber ...after running the program I got the below error please let me KNow more details what should... (2 Replies)
Discussion started by: atiato
2 Replies
Login or Register to Ask a Question