Home > Syntax Error > Bash Function Syntax Error Unexpected

Bash Function Syntax Error Unexpected


the script can't be executed The error message can vary. Removing temporary plugin and exiting..." as_user "rm $TEMPPLUGINS/$JARNAME"; exit;; esac done echo "Would you like to start the $SERVICE now? [Y/n]?" select yn in "Yes" "No"; do case $yn in Yes The PID to wait for #Unlike the AutoIt version, this sleeps 1 second while [ $(kill -0 "$1") ]; do sleep 1 done } function RunApplication() { #This takes 1 application, Error messages actually mean something. http://onlinetvsoftware.net/syntax-error/bash-function-syntax-error-near-unexpected-token.php

Thanx. #!/bin/bash color_def="~/.colorrc" if -f $color_def; then . $color_def else # color definitions black="$(tput setaf 0)" darkgrey="$(tput bold ; tput setaf 0)" lightgrey="$(tput setaf 7)" white="$(tput bold ; tput setaf 7)" 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 are the canonical white spaces? Then, when I rm bash, which is just a symlink, and then install, I get this: apt-get install bash ...

Bash Syntax Error Unexpected Token

Success! Though my OS X is running a much older version of bash. –Jay Soyer Aug 16 at 13:26 add a comment| Your Answer draft saved draft discarded Sign up or 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. Realism of a setting with several sapient anthropomorphic animal species Is the empty set homeomorphic to itself?

And sh has been linked to dash [email protected]:~/home/Codebox$ ll /bin/bash -rwxr-xr-x 1 root root 818232 2010-04-19 07:21 /bin/bash* [email protected]:~/home/CodeBox/$ ll /bin/sh lrwxrwxrwx 1 root root 4 2010-09-04 07:30 /bin/sh -> dash* did you close your if with a fi? share|improve this answer answered Jan 22 '13 at 22:34 mauro 11 2 The missing shebang was already accepted as the answer by the original poster. –Philipp Claßen Jan 22 '13 Bash Syntax Error Near Unexpected Token Browse other questions tagged linux osx bash scripting syntax-error or ask your own question.

Please stop the service before adding a plugin." else echo "Paste the URL to the .JAR Plugin..." read JARURL JARNAME=$(basename "$JARURL") if [ -d "$TEMPPLUGINS" ] then as_user "cd $PLUGINSPATH && Bash Syntax Error Unexpected End Of File Please delete my previous version and post this one instead. dwhitney67August 2nd, 2008, 06:28 AMThat's just masking the problem, so I think it's a bad idea. Which version of bash/linux have this limitation?

What could cause the throttle to stick in my Ford Ranger? Bash Syntax Error Near Unexpected Token Done' Good way to explain fundamental theorem of arithmetic? script.sh: line 50: unexpected EOF while looking for matching `"' script.sh: line 100: syntax error: unexpected end of file This one indicates the double-quote opened in line 50 does not have bash is already the newest version.

Bash Syntax Error Unexpected End Of File

Altering the file would in essence create a branch from its official version. more hot questions question feed about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science Bash Syntax Error Unexpected Token What to tell to a rejected candidate? Syntax Error Unexpected End Of File Bash Script Not the answer you're looking for?

The various parts of the script prompt are printed in color. http://onlinetvsoftware.net/syntax-error/bash-syntax-error-end-of-file-unexpected.php On my system, I removed the /bin/sh link to dash, and changed it to point to /bin/bash. Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Hope this helps. Bash Syntax Error Redirection Unexpected

Verbs of buttons on websites So sayeth the Shepherd What does an 'ü' mean? Will the medium be able to last 100 years? Mark Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. http://onlinetvsoftware.net/syntax-error/bin-sh-function-syntax-error-unexpected.php On THE other hand or on another hand?

I don't have any real experience with dash, but I do remember that there are slight differences when it comes to (among other things) functions. Bash Syntax Error Near Unexpected Token Echo' I ran one of my old scripts and all was fine. If not, why?

madams11August 2nd, 2008, 03:40 PMRun the Synaptic manager: System->Administration->Synaptic Package Manager Once it is up and running, search for bash.

Write logfiles For more complex scripts, it's useful to write to a log file, or to the system log. 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 git commit -am "automated push $(date +"%Y-%m-%d")" git push -u } cd ~/htdocs automate If I run this command, the script works as expected: . ~/bin/auto_git_push.sh However, with this crontab line Bash Syntax Error Near Unexpected Token (' Ubuntu I already have automake (GNU automake 1.9.6) and aclocal (GNU automake 1.9.6).

Well, you would be surprised how many shell users ignore the text of error messages! some code ... Do I have to remove dash first? weblink Main Menu LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest

Train ride from Copenhagen to Malmo What is the sh -c command? This is the default. share|improve this answer answered Jan 30 '13 at 20:00 bonsaiviking 91848 Thanks for this clarification! –hookedonwinter Jan 31 '13 at 16:01 add a comment| You must log in to Once you find something that works, you can either use it or continue searching for something more appealing to your aesthetics.

MSDOS uses: \r\n (ASCII CR #13 ^M, ASCII LF #10) UNIX┬« uses: \n (ASCII LF #10) Keep in mind your script is a plain text file, and the CR character means [email protected]:~/home/Codebox$ bash --version GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu) man bash still says that I can use my earlier style of function definitions Code: Shell Function Definitions Shell functions are declared as Join them; it only takes a minute: Sign up Empty function in BASH up vote 9 down vote favorite I'm using FPM tool to create .deb package. The other lesson here is that there are few reasons anymore to use sh.

druuna View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by druuna View Blog 09-19-2010, 05:24 AM #6 luvshines Member Registered: Apr 2009 Why can a Gnome grapple a Goliath? Is the empty set homeomorphic to itself? Blogs Recent Entries Best Entries Best Blogs Blog List Search Blogs Home Forums HCL Reviews Tutorials Articles Register Search Search Forums Advanced Search Search Tags Search LQ Wiki Search Tutorials/Articles Search

exit $? # It is even possible to use functions to override #+ or preempt system commands. # Of course, this is *not* advisable.