Home > Syntax Error > Bash Syntax Error Unexpected

Bash Syntax Error Unexpected

Contents

Dropping the word function and adding paran worked for me too. On my system, I removed the /bin/sh link to dash, and changed it to point to /bin/bash. Use all the bashisms you want, but call it with bash. But, I did use aptitude, and tried to install bash. his comment is here

Finding a file starting with '-' dash Does mean=mode imply a symmetric distribution? That is because parentheses are used for grouping by the shell such that they are not communicated in any way to a command. Not the answer you're looking for? In your own answer, you say you fixed the problem by using chsh to change your default login shell to /bin/bash.

Bash Syntax Error Unexpected Token

Join them; it only takes a minute: Sign up bash Syntax error: “(” unexpected up vote 5 down vote favorite 1 For some reason this function is working properly, the terminal bash shell ubuntu shell-script share|improve this question edited Aug 18 '12 at 12:08 Gilles 369k666681119 asked Aug 18 '12 at 11:37 kemra102 4681613 The shebang is really in line 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 Can filling up a 75 gallon water heater tank without opening a faucet cause damage?

Is the standard Canon 18-55 lens the same as 5 years ago? Can Customs make me go back to return my electronic equipment or is it a scam? Something else might be broken, because .bashrc tries to execute when I log in and it crashes when it comes to the first command that is unique to bash (instead of Bash Syntax Error Near Unexpected Token Echo' I didn't notice anything until I was running a script with #!/bin/sh which actually meant /bin/bash.

I do know that /bin/bash is a symbolic link to /bin/dash at the moment. Bash Syntax Error Unexpected End Of File But interestingly, on the correct arch the file beginning with #! /bin/sh executed perfectly. I sent the script to by brother........ Something else might be broken, because .bashrc tries to execute when I log in and it crashes when it comes to the first command that is unique to bash (instead of

After executing these commands, bash array.sh produced the desired result. Bash Syntax Error Near Unexpected Token (' Ubuntu In a GNU C macro envSet(name), what does (void) "" name mean? when I run the script, even if I don't call this function at all, which is also what we want. Meaning of "soul-sapping" How does Gandalf get informed of Bilbo's 111st birthday party?

Bash Syntax Error Unexpected End Of File

Below is the first lines in the script, line 13 in red. #!/bin/sh # NOTE: # Versions 1.9 (or higher) of aclocal and automake are required. # For Mac OSX users: How to map and sum a list fast? Bash Syntax Error Unexpected Token This makes me think that bash might be installed somewhere else, but I sure can't find it. Bash Array Syntax Error Unexpected How to map and sum a list fast?

The proper solution, of course, is to fix the scripts, which are buggy by definition. http://onlinetvsoftware.net/syntax-error/bash-syntax-error-end-of-file-unexpected.php Grab a bash binary of the same version from somewhere and manually install it. Try to move the shebang in line 1. –manatwork Aug 18 '12 at 11:45 According to that article calling /bin/bash directly instead of /bin/sh will; correctly use bash instead Finding a file starting with '-' dash Meaning of "soul-sapping" Problem with using pause and onslide in one frame What does the "Phi" sign stand for in musical notation? Bash Syntax Error Near Unexpected Token Done'

I can still move the shebang of course, but that doesn't really explain as to why it works when you don’t sudo the whole script. –kemra102 Aug 18 '12 at 11:50 Was running wrong arch executable. Good way to explain fundamental theorem of arithmetic? http://onlinetvsoftware.net/syntax-error/bash-function-syntax-error-unexpected.php 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

I will stick to using ./ from now on. Bash Syntax Error Near Unexpected Token Else' Now that bash is installed, I think I can get all of the login scripts to work again. Least Common Multiple Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc?

Can Customs make me go back to return my electronic equipment or is it a scam?

Then, when I rm bash, which is just a symlink, and then install, I get this: apt-get install bash ... There is nothing about this line running as sudo that should stop it working to my knowledge, does anyone have any ideas? Now when run this script install and sets up the environment without error but you have to enter your sudo password more than once due to sudo's time-out value by default. Bash Syntax Error Near Unexpected Token Fi' Finding a file starting with '-' dash Please explain the local library system in London, England spectral norm of block-wise sums of matrices American English: are [ə] and [ʌ] different phonemes?

Which requires more energy: walking 1 km or cycling 1 km at the same speed? Browse other questions tagged bash shell ubuntu shell-script or ask your own question. If those answers do not fully address your question, please ask a new question. 2 If you mean bash then run bash and not sh (for run_verification.sh). check over here 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

Unix & Linux Stack Exchange works best with JavaScript enabled Ubuntu Forums > The Ubuntu Forum Community > Ubuntu Specialised Support > Development & Programming > Programming Talk > running sh-script, When you run it using ./ it will use the shell you mention on first line, in your case: #!/bin/sh if you do a ls -l /bin/sh you will see that Run from a command line: dpkg -S /bin/bash to see what package create the link (i doubt that the link it's part of any package anyway... current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list.

Setting the paths is only for Mac OSX users, so I didn't try to set any of those paths. It makes sense now. 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 source: http://wiki.solusvm.com/index.php/Console_Tools bash syntax newline token share|improve this question asked Feb 27 '11 at 16:36 Jonathan.V 108127 add a comment| 1 Answer 1 active oldest votes up vote 23 down vote

Not the answer you're looking for? On the first one I create an array thus: #!/bin/bash target_array=( "/home/user/direct/filename -p123 -r" ) That works fine. However in checking, I found that sh is a link to dash and bash is also a link to dash. share|improve this answer edited Aug 9 '14 at 20:50 answered Aug 9 '14 at 20:23 Keith Thompson 145k19190339 add a comment| up vote 1 down vote Instead of using sh to

What to tell to a rejected candidate? madams11August 2nd, 2008, 03:40 PMRun the Synaptic manager: System->Administration->Synaptic Package Manager Once it is up and running, search for bash. I accepted a counter offer and regret it: can I go back and contact the previous company? asked 1 year ago viewed 4475 times active 1 year ago Linked 3 I am getting error “array.sh: 3: array.sh: Syntax error: ”(“ unexpected” 1 `Syntax error: “(” unexpected` when trying

Replace dir=$(basename $(dirname "$file")); With dir=$(basename "$(dirname "$file")"); This should resolve your error, however, there are other few things I recommend: echo [`date`] "$file" added to queue. >> /var/log/torrentwatch.log I would