Dropping the word function and adding paran worked for me too. share|improve this answer answered Mar 26 '15 at 19:54 that other guy 45.5k54170 I didn't realize there's a difference. The shell used to execute a script is not affected by which shell you're currently using or by which shell is configured as your login shell in /etc/passwd or equivalent (unless Syntax error: unexpected “(”-3Shell script- syntax error: unexpected end of file2Create array in bash with variables as array name0Syntax Error: unexpected end of file — Bash script1“bad array subscript” error when http://crimsonskysoftware.com/syntax-error/unexpected-syntax-error.html
What was the first operating system to feature a separate kernel? My system is still not quite right, but the aptitude reinstall bash worked in that I now have bash again. Was running wrong arch executable. Sometimes some hidden characters are there in the source. http://unix.stackexchange.com/questions/45781/shell-script-fails-syntax-error-unexpected
The time now is 10:38 PM. - Contact Us - UNIX & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top If you execute it by typing something like: sh ./array.sh then it will execute it using /bin/sh. The package manager is supposed to force you to jump through hoops to remove either one, because the absence of one or the other can cause major problems. Why does removing Iceweasel nuke GNOME?
madams11August 3rd, 2008, 05:22 PMSomething's screwy on your system. It's most probably missing fi or } somewhere, but without indentation you won't ever see where. –Jan Hudec Mar 27 '12 at 9:17 What is the assignment to value What was that alien in Doctor Who that nobody saw? Line 1: Syntax Error: Unexpected Word (expecting ")") To fix the issue use bash instead of using sh while executing the script, that should not throw any syntax error.
OK... Syntax Error At Line 1 (' Unexpected In Shell Script As you can probably tell I'm quite new to Linux (currently trying to convert my Powershell scripts shell/bash scripts). Is Certificate validation done completely local? Related 2944Can a Bash script tell which directory it is stored in?757How do I parse command line arguments in bash?315How do I know the script file name in a Bash script?1641How
check_and_start Hello,\ World! Bash Function Syntax Error: "(" Unexpected My advisor refuses to write me a recommendation for my PhD application unless I apply to his lab Is giving my girlfriend money for her mortgage closing costs and down payment This server was installed with Ubuntu 7.10 server 64-bit. Remove advertisements Sponsored Links gary_w View Public Profile Find all posts by gary_w #5 06-05-2012 Scrutinizer Moderator Join Date: Nov 2008 Last Activity: 30 October 2016, 4:14
Fixed by running dos2unix on the script, with proper description of problem and solution given in that answer share|improve this answer answered Feb 6 '15 at 9:47 shtolik 362713 add a Given that ice is less dense than water, why doesn't it sit completely atop water (rather than slightly submerged)? Syntax Error ( Unexpected Bash Array I started writing a new one and got the above error. Syntax Error ( Unexpected Ubuntu asked 4 years ago viewed 107398 times active 11 months ago Related 2Shell script error message1/shell-script: syntax error near unexpected token `done'4Shell Script - syntax error near unexpected token `else'0Shell script
share|improve this answer edited Aug 9 '14 at 20:50 answered Aug 9 '14 at 20:23 Keith Thompson 148k19196349 add a comment| up vote 1 down vote Instead of using sh to Check This Out My advisor refuses to write me a recommendation for my PhD application unless I apply to his lab My 21-year-old adult son hates me How to apply for UK visit visa msseverAugust 2nd, 2008, 09:01 PMThanks for the suggestions. On my system, I removed the /bin/sh link to dash, and changed it to point to /bin/bash. Ksh: Syntax Error: `(' Unexpected
I already have automake (GNU automake 1.9.6) and aclocal (GNU automake 1.9.6). Thanks a lot! Player claims their wizard character knows everything (from books). Source What game is the guard playing in this picture?
Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the Syntax Error At Line 1 (' Unexpected Solaris maybe dash create it by default if bash it's not installed) You can rm the symlink and install bash: sudo rm /bin/bash sudo apt-get install bash hth madams11August 2nd, 2008, 08:20 nothing has changed!
What is way to eat rice with hands in front of westerners such that it doesn't appear to be yucky? After executing these commands, bash array.sh produced the desired result. However I recorded this answer so that if someone else faces this strange behavior in the system, he may find this solution helpful. –Mistu4u Aug 9 '14 at 20:13 4 Sh: 1: Syntax Error: "(" Unexpected Python EDIT: Because bash is a superset of sh, any sh script (including bash scripts that masquerade as sh) should still run when executed by bash.
I can't find the actual bash shell anywhere. Integer function which takes every value infinitely often Why is the FBI making such a big deal out Hillary Clinton's private email server? Since dash (like all other shells) is an interpreter, it won't complain until the execution reaches the problematic line. have a peek here Browse other questions tagged bash shell or ask your own question.