Home > Syntax Error > Bash Syntax Error Redirection Unexpected

Bash Syntax Error Redirection Unexpected

Contents

These numbers are called "file descriptors". (…) The redirection operators can be preceded by one or more digits (with no intervening characters allowed) to designate the file descriptor number. Due to Ubuntu's DashAsBinSh affinity I suspect your script is interpreted by dash instead of bash. This works without problems. Good way to explain fundamental theorem of arithmetic? http://sovidi.com/syntax-error/bin-sh-syntax-error-redirection-unexpected.php

Realism of a setting with several sapient anthropomorphic animal species Video displays in Star Wars Good way to explain fundamental theorem of arithmetic? make View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by make Thread Tools Show Printable Version Email this Page Search this Thread Advanced I'm very confused by this. The default system shell in Ubuntu is dash, not bash, so if you have #!/bin/sh then your script will be using a different shell than you expect.

/bin/sh 1 Syntax Error Redirection Unexpected

Is there any other way? Executing sudo sh ./sonar.sh console. 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 What am I doing wrong?

Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc? I ran "/usr/sbin/update-binfmts --display" expecting to see an association between a "sh" extension and "/bin/sh" but there was none. Yes, of course I'm an adult! Bash Syntax Error Near Unexpected Token Done' Williams 114 You might want to read about the select command in bash. –chepner Sep 13 '13 at 13:12 add a comment| 2 Answers 2 active oldest votes up

Running the scripts with "bash script-name" is fine with me, regardless of the extensions. If not, why? Good way to explain fundamental theorem of arithmetic? For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration.

Sometimes some hidden characters are there in the source. Bash Syntax Error Near Unexpected Token Echo' 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 asked 4 years ago viewed 103156 times active 10 months ago Related 2Shell script error message1/shell-script: syntax error near unexpected token `done'4Shell Script - syntax error near unexpected token `else'0Shell script Just checked the spam folder, nope no e-mail from Github there too.

Bash Syntax Error Unexpected Token

When all is fixed, change the shebang to #!/bin/bash. This will output a HTML-free plaintext version of the file that cau be wget-ted. /bin/sh 1 Syntax Error Redirection Unexpected Browse other questions tagged command-line scripts or ask your own question. Bash Syntax Error Unexpected End Of File Rosa Parks is a [symbol?] for the civil rights movement?

I'll mark this as resovled! http://sovidi.com/syntax-error/bash-syntax-error-unexpected-expecting-done.php make View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by make 02-06-2012, 06:23 AM #2 everToulouse LQ Newbie Registered: Apr 2010 Posts: In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms 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 Bash Syntax Error Near Unexpected Token

You also gave yourself and all other users read and write permissions, as well as execute permission to all other users. Adding the shebang line solved it immediately. +1. –bkd.online Oct 9 '13 at 5:14 Facing the issue running sonarqube.sh on Ubuntu 15.10. What to tell to a rejected candidate? navigate here It must be prefixed by ./ or similar.

Given the line the error is on, it looks like you're trying to run an HTML file. Bash Syntax Error Near Unexpected Token (' Ubuntu How to deal with a very weak student? To run it as root, put sudo in front of the command that runs it.

Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us.

Force Microsoft Word to NEVER auto-capitalize the name of my company more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info My guess is the script is actually a bash script, which is not the same as an sh script. Browse other questions tagged bash shell ubuntu shell-script or ask your own question. Bash Syntax Error Near Unexpected Token Else' 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.

What is the sh -c command? 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 But, somewhere there is some code that examines the file suffix and overrides (or ignores) the shebang line. http://sovidi.com/syntax-error/bash-array-syntax-error-unexpected.php Symbolic comparison of recursive functions American English: are [ə] and [ʌ] different phonemes?

Dennis numbers 2.0 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 Intuition behind Harmonic Analysis in Analytic Number Theory I accepted a counter offer and regret it: can I go back and contact the previous company? Browse other questions tagged bash perl backticks or ask your own question. In future note that there's a "plain" link above the code (Github calls it "raw").

asked 1 year ago viewed 1344 times active 1 year ago Related 4Do redirection operators always open file descriptors in parallel?0Capture Error of LS to file2syntax error: unexpected end of file9Unexpected Yet most shells only parse the number before the operator as a file descriptor if it consists of a single digit. This site is not affiliated with Linus Torvalds or The Open Group in any way. Do COB LEDs usually need electrically insulating from the heatsink?

wait till someone tracks down the source and posts here 1 members found this post helpful. Can a creature benefit from differently typed speed bonuses all named fast movement? Why? Verbs of buttons on websites Symbolic comparison of recursive functions GTIN validation Why write an entire bash script in functions?

current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. 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 How does Gandalf get informed of Bilbo's 111st birthday party? Intuition behind Harmonic Analysis in Analytic Number Theory My girlfriend has mentioned disowning her 14 y/o transgender daughter Unexpected parent process id in output Does mean=mode imply a symmetric distribution?

There is nothing about this line running as sudo that should stop it working to my knowledge, does anyone have any ideas? This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. How to handle spending money for extended trip to Europe?