Bin/sh 1 Syntax Error Unexpected Ubuntu
Contents |
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 bin sh c line 1 syntax error unexpected end of file IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch bin sh c line 0 syntax error near unexpected token Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login bin sh 1 syntax error unterminated quoted string Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk running sh-script, resulting in Syntax error: "(" unexpected Having an Issue With Posting ? Do you want to syntax error: "(" unexpected bash help us debug the posting issues ? < is the place to report it, thanks ! Page 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
Syntax Error Unexpected Array
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 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
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
Syntax Error At Line 1 (' Unexpected In Shell Script
Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users ksh syntax error unexpected Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes line 1: syntax error: unexpected word (expecting ")") 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 https://ubuntuforums.org/showthread.php?t=499045 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 http://askubuntu.com/questions/692378/why-does-my-script-return-a-syntax-error 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 !(dynmap) syntax is only recognized when the extglo
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/17944710/how-to-fix-bin-sh-syntax-error-unexpected-without-changing-to-bin-bash 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 Stack Overflow Questions 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 syntax error each other. 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 syntax error unexpected –I(STAGING_DIR)/usr/include/ LDFLAGS = -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 sur