Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error at line 157 : `(' unexpected 2

Status
Not open for further replies.

pbdude

Programmer
Feb 6, 2003
3
US
Hello all,

This error: syntax error at line 157 : `(' unexpected, is causing me heartache.

Specs:
6 x CPU "400 MHz SUNW,UltraSPARC-II"
1.5 GB RAM
4 x HDD FUJITSU M2954ESP SUN4.2G" 4.0 GB disk drive for OS
4 x A5000 FCAL Storage Enclosures, Dual connectivity for redundant data paths
6 x HDD for Application. Data is striped across 3 HDD, and Mirrored to 3 HDD. Each Disk group in a different enclosure providing 4 datapaths available to the application.
2 x 100BT Ethernet ( production/backup network ).
Sun Solaris 2.7
korn shell

I'm really confused about this error. What's at this line is this: echo "Downloaded $total_files_downloaded file(s)." >> $LOG_FILE.

I don't understand why it's looking at an echo'd line in the first place. Keep this in mind too, it worked before. It just stopped working for some reason. Sure I added some code but it should not have anything to do with this. Just for sanity's sake I backed out all the code that I did before and ran it but with the same results. This happened with the same script a few days ago. So I started over with the script I am on now. Now when I go back to the original script, IT WORKS!! Does anybody have a similar situation or fix?

Thank You,
Rene
 
You've got a stray parentheses somewhere in the script. Count all the open parens and all the closed parens and you'll find it.
 
Solved, this was an ID10T error. I apologize. The issue was that I didn't end a quote earlier in the script for another echo comment. Therefore, it came to this line and because it saw the first quote and intepreted it as the closing quote for the earlier echo. That's why the parentesis was unexpected.

Thanks for your response(s)
Rene
 
You're welcome. I've found the shell keeps better track of open and close parens better than I do!
 
The % command in vi is very handy in these situations. If you put your cursor over a bracket (of any kind, "{", "(" or "]") and press % it will move your cursor to the matching bracket. If it doesn't go where you expect it to you have a missing or extra bracket. Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top