Find all posts by cfajohnson #4 03-05-2009 figaro Registered User Join Date: Jan 2007 Last Activity: 27 August 2016, 2:57 PM EDT Posts: 842 Thanks: 93 Thanked 29 In order to solve the issue, I found a link where it was described to be gone by using the following code. Should indoor ripened tomatoes be used for sauce? It will almost always fail on Debian-ish distributions where sh is dash. Check This Out
Since dash (like all other shells) is an interpreter, it won't complain until the execution reaches the problematic line. In your own answer, you say you fixed the problem by using chsh to change your default login shell to /bin/bash. My girlfriend has mentioned disowning her 14 y/o transgender daughter Is the empty set homeomorphic to itself? Using Map to convert Feet + Inches to Inches in a List of Lists Is there a way to make a metal sword resistant to lava?
Can I use an HSA as investment vehicle by overcontributing temporarily? The time now is 08:52 PM. - Contact Us - Unix & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top Hot Network Questions So sayeth the Shepherd Are there any 'smart' ejection seats? On Ubuntu, /bin/sh is dash, a shell designed for fast startup and execution with only standard features.
Only got the error message when I separated the commands: $ sudo sh # ./install hope it helps share|improve this answer answered Nov 27 '15 at 22:00 user145114 1 Personal Open source Business Explore Sign up Sign in Pricing Blog Support Search GitHub This repository Watch 22 Star 1,054 Fork 28 mchav/with Code Issues 9 Pull requests 2 Projects 0 Yes, of course I'm an adult! Syntax Error ( Unexpected Bash Array 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?
ulysses4ever commented Aug 18, 2016 • edited I tried it (and got above mentioned error) in gnome-terminal. share|improve this answer answered Aug 9 '14 at 20:00 Mistu4u 1,46662352 3 Strange. Remove advertisements Sponsored Links jim mcnamara View Public Profile Find all posts by jim mcnamara
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 Unexpected In Shell Script Should indoor ripened tomatoes be used for sauce? The shebang line must be the very first thing in the file. Try running sh ./array.sh and see if you get the same error.
share|improve this answer answered May 4 '15 at 18:54 geirha 21.3k84653 "don't put .sh extension on a bash script"? Password Home Search Forums Register Forum RulesMan PagesUnix Commands Linux Commands FAQ Members Today's Posts Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK Bash Syntax Error Unexpected Token Why? –muru May 4 '15 at 19:21 @muru, because bash is not sh, so it's misleading. Syntax Error Unexpected Expecting Keyword_end Example: Run arrays.sh as $ bash arrays.sh -Sany Rate this:Share this:ShareTweetPocketShare on TumblrEmailPrintLike this:Like Loading...
How to pluralize "State of the Union" without an additional noun? http://gatoisland.com/syntax-error/bash-script-array-syntax-error-unexpected.php command). Problem with using pause and onslide in one frame In a GNU C macro envSet(name), what does (void) "" name mean? UNIX is a registered trademark of The Open Group. Syntax Error Unexpected Expecting End Syntaxerror
If you see a \r in the above, see FAQ 52 for various ways to get rid of them. I don't think this is a solution, only a 'work around'. –Bjørne Malmanger Aug 9 '14 at 20:07 @BjørneMalmanger, Agreed! On Debian, sh is usually dash which has no array support (a[index]=x won't work). –Stéphane Chazelas Jan 7 at 15:38 add a comment| up vote 0 down vote Running ./scriptname.sh will this contact form Browse other questions tagged bash shell ubuntu shell-script or ask your own question.
Ksh88 was limited to 1023 elements, but I don't think it accepted that syntax for assigning a number of elements to an array. Ksh Syntax Error Unexpected When was this language released? 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
How to increase the population growth of the human race How would family relationships change if legal system uses collective punishment? What does the "Phi" sign stand for in musical notation? Adopt A Jet/Book How to map and sum a list fast? Syntax Error ( Unexpected Ubuntu One possible explanation would be if you had a space character in between the equal sign and the open parenthesis, in which case you'd get the following: [email protected]:~/stuff$ ./test ./test: line
You signed out in another tab or window. Join Date: Feb 2004 Last Activity: 1 October 2016, 1:25 PM EDT Location: NM Posts: 10,825 Thanks: 446 Thanked 968 Times in 899 Posts Chris - With regard to arrays - try cat -v script to see if there are spurious char. –LilloX Jan 7 at 14:50 2 sh is not bash and so running it as sh scriptname.sh is wrong http://gatoisland.com/syntax-error/bash-array-syntax-error-near-unexpected-token.php There is nothing about this line running as sudo that should stop it working to my knowledge, does anyone have any ideas?
How's the CMD trip bonuses from extra legs work? Find all posts by cfajohnson
Lloyd B. Small changes to improve readability matter in the long run because 95% of the cost of software is in maintenance.... But interestingly, on the correct arch the file beginning with #! /bin/sh executed perfectly. Unless this is a massive system operation running in an environment where you need to limit process resource usage as much as possible, code obfuscation in an attempt to gain performance
The users who voted to close gave this specific reason:"This is not about Ubuntu. Symbolic comparison of recursive functions How to book a flight if my passport doesn't state my gender? What could cause the throttle to stick in my Ford Ranger? When taking passengers, what should I do to prepare them?
You have two options to make sure the script is interpreted by bash: Move the shebang to the first line Run sudo like this: sudo bash ./pi_dev_env_install.sh share|improve this answer answered When taking passengers, what should I do to prepare them? As you can probably tell I'm quite new to Linux (currently trying to convert my Powershell scripts shell/bash scripts). Thanks again.
On a side note, don't put .sh extension on a bash script, and don't run a bash script with sh. share|improve this answer answered Jan 22 '13 at 22:34 mauro 11 2 The missing shebang was already accepted as the answer by the original poster. –Philipp Claßen Jan 22 '13