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.
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?
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?
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
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