Home > Syntax Error > Bash Array Syntax Error Unexpected Expecting

Bash Array Syntax Error Unexpected Expecting


more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Good way to explain fundamental theorem of arithmetic? Hot Network Questions So sayeth the Shepherd Are there any 'smart' ejection seats? In terms of good practice you are not. http://onlinetvsoftware.net/syntax-error/bash-array-syntax-error-word-unexpected-expecting.php

Just coding for the 'next guy'. If you have edited this script from windows, that would explain why. On Ubuntu, /bin/sh is dash, a shell designed for fast startup and execution with only standard features. What's the difference?

Bash Syntax Error Unexpected Token

Adopt A Jet/Book How to map and sum a list fast? American English: are [ə] and [ʌ] different phonemes? When dash reaches line 68, it sees a syntax error: that parenthesis doesn't mean anything to it in context.

Remove advertisements Sponsored Links jim mcnamara View Public Profile Find all posts by jim mcnamara

Page 1 of 2 1 2 > « Previous Thread | Next Thread » Thread Train ride from Copenhagen to Malmo Skeletal formula for carbon with two double bonds How does Gandalf get informed of Bilbo's 111st birthday party? share|improve this answer answered Jan 7 at 15:02 joepd 1,371615 Even if sh is a symlink to bash it will behave differently when invoked as sh –Eric Renouf Jan Syntax Error ( Unexpected Bash Array Since you use bash features, the first line of the file must be #!/bin/bash or #!/usr/bin/env bash.

You signed out in another tab or window. Bash Syntax Error Unexpected End Of File Now, that leaves me puzzled. –soufrk Sep 1 at 7:07 add a comment| up vote 3 down vote If the shebang is not on the first line, it will not be Perderabo & I have gone around on this as well. Some of the other posts asked people to run commands and study the output (again, with no resolution posted), so I will post those here in hopes that someone can help

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Syntax Error Unexpected In Shell Script We recommend upgrading to the latest Safari, Google Chrome, or Firefox. There is a concept: self-documenting code. QuikeeMay 15th, 2007, 02:27 PMI did my own example and "a=( a b c )" works for me..

Bash Syntax Error Unexpected End Of File

How to increase the population growth of the human race How would family relationships change if legal system uses collective punishment? You may have an old version of bash. –Ned Deily Aug 9 '14 at 19:46 @NedDeily, 4.3.8(1)-release –Mistu4u Aug 9 '14 at 19:47 1 Add set -x after Bash Syntax Error Unexpected Token When was this language released? Syntax Error Unexpected Expecting Keyword_end I accepted a counter offer and regret it: can I go back and contact the previous company?

Why? –muru May 4 '15 at 19:21 @muru, because bash is not sh, so it's misleading. this content I will stick to using ./ from now on. Problem with using pause and onslide in one frame Natural construction Were slings used for throwing hand grenades? thank you everyone... Syntax Error Unexpected Expecting End Syntaxerror

Not the answer you're looking for? But it can be invoked as "sh -c {script}" or "dash -c {script}", and the "#!/bin/bash" *is* correctly handled to invoke the bash shell. Simpler to just run "./test", which works correctly regardless of your default shell, and only invokes an extra copy of "bash" if one is required. weblink Can I use an HSA as investment vehicle by overcontributing temporarily?

How to deal with a really persuasive character? Ksh Syntax Error Unexpected Send to Email Address Your Name Your Email Address Cancel Post was not sent - check your email addresses! But when you use sh scriptname.sh it executes sh, not bash.

So even if the script successfully started at some point in your testing, it would have aborted once line 68 was reached.

Not the answer you're looking for? All rights reserved. When I create a script and try to use an array like this: #!/bin/bash names=( Jennifer Tonya Anna Sadie ) for name in ${names[@]} do echo $name done I get this Syntax Error ( Unexpected Ubuntu command-line bash scripts sh share|improve this question edited May 4 '15 at 19:12 0xF2 2,04621538 asked May 4 '15 at 18:40 Kwiatkowski 91 closed as off-topic by muru, Fabby, David Foerster,

I still get this error, pointing to the line that begins arrIN=... 8: run_all_verification.sh: Syntax error: "(" unexpected (expecting "done") The shell script: #!/usr/bin/bash #base name for all experiments BASE_EXP_ID=$1; for The sh shell has no syntax to create arrays, but Bash has the syntax you used. Symbolic comparison of recursive functions How to extrude a face parallel to another? check over here Eh, what?

Did Donald Trump call Alicia Machado "Miss Piggy" and "Miss Housekeeping"? Force Microsoft Word to NEVER auto-capitalize the name of my company Is the standard Canon 18-55 lens the same as 5 years ago? And/or with dpkg -S $(which sh). share|improve this answer answered Mar 26 '15 at 19:54 that other guy 45k54070 I didn't realize there's a difference.

cheers –IGGt Jan 7 at 15:24 That's not necessarily, but there must be coordination between #!/bin/sh and sh script.sh (or #!/bin/bash and bash script.sh) –Konstantin Morenko Jan 7 at Browse other questions tagged arrays bash shell ubuntu or ask your own question. Why? UNIX is a registered trademark of The Open Group.

Using Map to convert Feet + Inches to Inches in a List of Lists How to indicate you are going straight? I will try running the script as you did when I get home from work, and see if I get the same results. chsh -s /bin/bash adhikarisubir grep ^adhikarisubir /etc/passwd FYI, "adhikarisubir" is my username. Some sh interpreters support arrays, only ksh88 (not ported to Linux AFAIK) and some older pdksh variants would support a[index]=value and not a=(x y).

Executing sudo sh ./sonar.sh console.