Home > Syntax Error > Bash Shell Syntax Error Unexpected

Bash Shell Syntax Error Unexpected

Contents

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 I don't know why but the definition that starts with the keyword function never works for me. As you gain experience tracking down bugs, you will discover that bugs are often not where you first expect to find them. Not the answer you're looking for? navigate here

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 Unix & Linux Stack Exchange works best with JavaScript enabled current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. Here are the results: dpkg -S /bin/bash bash: /bin/bash Since bash is acually a link to dash, I'm not sure what this is telling me. I really appreciate the help.

Shell Syntax Error Unexpected End Of File

Why? When I run bash run_all.sh, I get 'Cannot open run_verification.sh', which is the script that is being called internally –Adam_G Mar 26 '15 at 20:10 Disregard. 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: I have to use the C-style function definition: check_and_start() { echo $1 } check_and_start World!

Should indoor ripened tomatoes be used for sauce? What does an 'ü' mean? Not the answer you're looking for? Linux Syntax Error Near Unexpected Token Then' A lot of people had problem, specially with custom scripts.

So, people who thought they were writing sh scripts were really writing a subset of bash. This is one reason you should test your scripts frequently when you are writing them so there is less new code to test. Since dash (like all other shells) is an interpreter, it won't complain until the execution reaches the problematic line. Also, I see that later on you use commas to separate arguments (MoveToTarget $SourcePath, $DestPath).

Can anyone shed some light on why this doesn't work? Linux Syntax Error Near Unexpected Token Newline' Will the medium be able to last 100 years? Subscribed! This site is not affiliated with Linus Torvalds or The Open Group in any way.

Syntax Error Unexpected Shell Script

Is the empty set homeomorphic to itself? I strongly suspect you did something else that fixed the problem. –Keith Thompson Aug 9 '14 at 20:15 add a comment| Your Answer draft saved draft discarded Sign up or Shell Syntax Error Unexpected End Of File So, I tried apt-get install bash, and it said I already had the latest version. Linux Syntax Error Unexpected End Of File Is the following extension of finite state automata studied?

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 check over here What the shell was trying to tell us was that there was only one item and there should have been a unary operator (like "!") that only operates on a single You will sometimes want to set a variable's value to nothing. UNIX is a registered trademark of The Open Group. Linux Syntax Error Near Unexpected Token

But, I did use aptitude, and tried to install bash. Not the answer you're looking for? 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 his comment is here How to deal with a very weak student?

Why would this appear?3syntax error near unexpected token `('1syntax error near unexpected token `if'0shell script syntax error: redirection unexpected during done command4syntax error near unexpected token `echo'8syntax error near unexpected token Syntax Error ( Unexpected Bash Array up vote 0 down vote Running ./scriptname.sh will result in reading the first line of the file and see that it needs to run ´/bin/bash´ and pass the rest of the You will see a problem develop at a certain point in your program and assume that the problem is there.

On Ubuntu, /bin/sh is dash, a shell designed for fast startup and execution with only standard features.

This is often incorrect, as we have seen. In a GNU C macro envSet(name), what does (void) "" name mean? Still getting the error. –soufrk Sep 1 at 6:58 @soufrk Is it sonarqube.sh or sonar.sh? Ksh Syntax Error Unexpected Due to Ubuntu's DashAsBinSh affinity I suspect your script is interpreted by dash instead of bash.

Linux is a registered trademark of Linus Torvalds. I also find that text editors with syntax highlighting (like nedit or kate) make these kinds of bugs easier to find. Adopt A Jet/Book Is the empty set homeomorphic to itself? weblink Subtraction with a negative result Unexpected parent process id in output I do not get any ether when mining How could banks with multiple branches work in a world without quick

Anyway, just put it here for your information. Are there any 'smart' ejection seats? Integral using residue theorem complex analysis Yes, of course I'm an adult!