Bin/sh 1 Syntax Error Unexpected
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss bin sh c line 1 syntax error unexpected end of file the workings and policies of this site About Us Learn more about bin sh c line 0 syntax error near unexpected token Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions bin sh 1 syntax error unterminated quoted string Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Line 1 Syntax Error Unexpected Word Expecting
Join them; it only takes a minute: Sign up how to fix /bin/sh: syntax error: unexpected “(” without changing to /bin/bash up vote 0 down vote favorite I have this makefile: SHELL = /bin/sh INSTALL =/usr/bin/install INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 STRIP=$(TARGET_CROSS)strip EXEC=monApp SRC= $(wildcard src/*.cpp) OBJ= $(SRC:.cpp=.o) CXX=$(TARGET_CROSS)g++ CXXFLAGS = -I./include –I$(STAGING_DIR)/include –I(STAGING_DIR)/usr/include/ LDFLAGS syntax error ( unexpected ubuntu = -g -Wall -L$(STAGING_DIR)/lib –lEGL –lGLESv2 –lIMGegl –L$(STAGING_DIR)/usr/lib all: $(EXEC) $(EXEC): $(OBJ) $(CXX) -o $@ $^ $(LDFLAGS) %.o: %.cpp @$(CXX) -o $@ -c $< $(CXXFLAGS) .PHONY: clean clean: @rm -rf src/*.o @rm -rf $(EXEC) install: $(EXEC) mkdir -p ./package.release $(INSTALL_PROGRAM) $(EXEC) ./package.release/ $(STRIP) ./package.release/$(EXEC) uninstall: @rm -rf ./package.release/ How do I fix this issue without changing to /bin/bash (i do not have bash so i have to use sh)? Thank you, bash shell makefile share|improve this question edited Jul 30 '13 at 10:39 Barmar 270k23124211 asked Jul 30 '13 at 10:37 Crazywiz Wiz 2314 4 Which line is the errr on? –Barmar Jul 30 '13 at 10:38 1 I don't see any parentheses in any of the shell commands. Those are all makefile variables that get substituted before running the shell. –Barmar Jul 30 '13 at 10:44 10 add missing $ to (STAGING_DIR) in the CXXFLAGS –J.F. Sebastian Jul 30 '13 at 10:44 Thank you Sebastian, after i googled the error i was sure it was because i wa
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media syntax error at line 1 (' unexpected in shell script Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu
Syntax Error At Line Unexpected
Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming
Syntax Error ( Unexpected Bash Array
Programming Talk running sh-script, resulting in Syntax error: "(" unexpected Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Page http://stackoverflow.com/questions/17944710/how-to-fix-bin-sh-syntax-error-unexpected-without-changing-to-bin-bash 1 of 2 12 Last Jump to page: Results 1 to 10 of 17 Thread: running sh-script, resulting in Syntax error: "(" unexpected Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode July 12th, 2007 #1 stigala View Profile View Forum Posts Private Message First Cup of Ubuntu Join Date Jul 2007 Beans 5 running sh-script, resulting in Syntax error: "(" unexpected Hi, I'm trying https://ubuntuforums.org/showthread.php?t=499045 to run a script on ubuntu 7.04; stig@stig-laptop:~/mosesdecoder$ ./regenerate-makefiles.sh ./regenerate-makefiles.sh: 13: Syntax error: "(" unexpected but then I get the syntax error. 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: # Standard distribution usually includes versions 1.6. # Get versions 1.9 or higher # Set the following variable to the correct paths #ACLOCAL="/path/to/aclocal-1.9" #AUTOMAKE="/path/to/automake-1.9" function die () { echo "$@" >&2 exit 1 } ... I already have automake (GNU automake 1.9.6) and aclocal (GNU automake 1.9.6). Setting the paths is only for Mac OSX users, so I didn't try to set any of those paths. Anyone can explain this? Thanks for any help, Stig Adv Reply July 12th, 2007 #2 Rui Pais View Profile View Forum Posts I Ubuntu, Therefore, I Am Join Date Oct 2004 Beans 2,324 Re: running sh-script, resulting in Syntax error: "(" unexpected Hi. the (inexistent) problem is the 1st line in combination with Ubuntu. 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 it's just a link to dash. Ubuntu, since Edgy, replaced old sh with dash, creating a series of incompatibil
Wiki Search Tutorials/Articles Search HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Non-*NIX Forums > Programming [SOLVED] /bin/sh: Syntax error: "(" unexpected User Name Remember Me? Password Programming http://www.linuxquestions.org/questions/programming-9/bin-sh-syntax-error-unexpected-906697/ This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game. Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. You http://askubuntu.com/questions/692378/why-does-my-script-return-a-syntax-error are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special syntax error features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? 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. If you need to reset your password, 1 syntax error click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. 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. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 10-06-2011, 02:58 AM #1 manojrb18 LQ Newbie Registered: Oct 2011 Posts: 2 Rep: /bin/sh: Syntax error: "(" unexpected Hi, I am getting below error while building the u-boot and flashloader source. [ENV] out/spi/u-boot-env.txt [ENV] out/spi/u-boot-env.bin /bin/sh: Syntax error: "(" unexpected make: *** [out/spi/u-boot.z77.pad] Error 2 I do not understand what can be the causes of this. I have tried changing the "/bi
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 answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 top Why does my script return a syntax error? up vote 1 down vote favorite I wrote this script, but I don't know why I have a syntax error: #!/bin/bash echo Indica la fecha de hoy en formato dd-mm-aaaa read date echo Indica la hora actual en formato hh-mm read hora mkdir -p /re/plugins shopt -s extglob cp -R /files/spigot/plugins/!(dynmap) /re/plugins shopt -u extglob cp -R /files/spigot/world /re zip -r "$date"-"$hora".zip plugins world mv /re/*.zip /var/www/html/backup rm -R /re Echo copia de seguridad realizada correctamente el dia "$date" a las "$hora"h > /log.txt The output root@alex:/home/alex# sh pb.sh Indica la fecha de hoy en formato dd-mm-aaaa aaa Indica la hora actual en formato hh-mm sdf pb.sh: 7: pb.sh: shopt: not found pb.sh: 8: pb.sh: Syntax error: "(" unexpected root@alex:/home/alex# bash scripts share|improve this question edited Oct 31 '15 at 21:22 Seth♦ 22.6k1687136 asked Oct 31 '15 at 21:08 thealejandroxv 162 2 Don't run bash scripts using sh (which is dash): see DashAsBinSh –steeldriver Oct 31 '15 at 21:15 shellcheck.net it works wonders (I'm beginner and needed to write script for myself) –MiHa Oct 31 '15 at 21:31 add a comment| 2 Answers 2 active oldest votes up vote 9 down vote Your problem is right here: root@alex:/home/alex# sh pb.sh shopt is a shell builtin (see type shopt). /bin/sh isn't bash on Ubuntu, but a compatibility shell called dash. Dash doesn't have shopt. Since the first line of your script is the shebang line (#!/bin/bash) you can just run your script like this: ./pb.sh and it should work fine. You may need to set the file as executable by running: chmod +x pb.sh share|improve this answer edited Nov 1 '15 at 1:25 heemayl 42.4k776129 answered Oct 31 '15 at 21:21 Seth♦ 22.6k1687136 add a comment| up vote 2 down vote pb.sh: 8: pb.sh: Syntax error: "(" unexpected The !(dyn