Home > Syntax Error > Bash Syntax Error Unexpected

Bash Syntax Error Unexpected

Contents

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 Here's the script: #!/bin/bash for file in /home/me/box/*/* do dir=$(basename $(dirname "$file")); sudo chmod 0777 /var/log/torrentwatch.log sudo chmod -R 0777 /home/me/box/*/* if "$file" = "/home/me/box/*/*.torrent"; then echo [`date`] "$file" added to more hot questions question feed lang-bsh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation There is nothing about this line running as sudo that should stop it working to my knowledge, does anyone have any ideas? this contact form

Meaning of "soul-sapping" How does Gandalf get informed of Bilbo's 111st birthday party? 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 And, I can't seem to install bash. Maybe it's the version of bash that we use??

Bash Syntax Error Unexpected Token

I tested your script and, under bash, it works for me. –John1024 Aug 9 '14 at 19:43 @John1024, bash array.sh prints blank in my case. –Mistu4u Aug 9 '14 madams11August 2nd, 2008, 03:40 PMRun the Synaptic manager: System->Administration->Synaptic Package Manager Once it is up and running, search for bash. Not the answer you're looking for? Browse other questions tagged bash bash-scripting .

spectral norm of block-wise sums of matrices Is the standard Canon 18-55 lens the same as 5 years ago? Related 2882Can a Bash script tell which directory it is stored in?729How do I parse command line arguments in bash?310How do I know the script file name in a Bash script?1608How Anyone can explain this? Bash Syntax Error Near Unexpected Token Echo' 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

Syntax error: unexpected “(”-3Shell script- syntax error: unexpected end of file9Unexpected EOF and syntax error0Syntax Error: unexpected end of file — Bash script-1Syntax Error: unexpected end of file — Bash script1C I really appreciate the help. A definition like the following function check_and_start { echo Hello } produces the error message: Syntax error: "}" unexpected If I put the { to a new line like: function my_function Should indoor ripened tomatoes be used for sauce?

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 (' Ubuntu 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 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 Integral using residue theorem complex analysis How does the pilot control the Dassault Rafale?

Bash Syntax Error Unexpected End Of File

Unexpected parent process id in output Skeletal formula for carbon with two double bonds Activate Hearthstone season chest cards? The script is linked in that article but convenience you can find it here also. Bash Syntax Error Unexpected Token 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 Bash Array Syntax Error Unexpected My system is still not quite right, but the aptitude reinstall bash worked in that I now have bash again.

But when you use sh scriptname.sh it executes sh, not bash. http://sovidi.com/syntax-error/bash-for-syntax-error-near-unexpected-token.php That is because parentheses are used for grouping by the shell such that they are not communicated in any way to a command. Least Common Multiple How to handle spending money for extended trip to Europe? Yes, of course I'm an adult! Bash Syntax Error Near Unexpected Token Done'

If you execute it by typing something like: sh ./array.sh then it will execute it using /bin/sh. but then again I added the line but the error is still coming. After executing them, the issue got resolved. http://sovidi.com/syntax-error/bash-syntax-error-unexpected-expecting-done.php On THE other hand or on another hand?

How to handle spending money for extended trip to Europe? Bash Syntax Error Near Unexpected Token Else' Join them; it only takes a minute: Sign up I am getting error “array.sh: 3: array.sh: Syntax error: ”(“ unexpected” up vote 3 down vote favorite 2 I have written the 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

Are there any 'smart' ejection seats?

same damn error. Linked 2 Syntax error: “(” unexpected (expecting “done”) 0 Error with simple shell script Related 18Bash array: Unexpected Syntax error34Bash script error: “function: not found”. works fine! Bash Syntax Error Near Unexpected Token Fi' If not, why?

It makes sense now. And, I can't seem to install bash. share|improve this answer answered Mar 2 at 20:31 yaobin 7192829 I'm having the same exact issue. his comment is here 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

check_and_start Hello,\ World! Using Map to convert Feet + Inches to Inches in a List of Lists Is the following extension of finite state automata studied? share|improve this answer answered Aug 18 '12 at 12:08 Gilles 369k666681119 1 Thanks clearly a gap in my knowledge, I don't script much so wasn't aware of that! 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.

Then I tried to rerun my original script again......