Bin/sh 1 Syntax Error Unexpected Make
Contents |
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 bin sh c line 1 syntax error unexpected end of file Learn more about Stack Overflow the company Business Learn more about hiring developers or bin sh c line 0 syntax error near unexpected token posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Bin Sh 1 Syntax Error Unterminated Quoted String
Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up how to fix /bin/sh: syntax error: unexpected “(” without
Syntax Error ( Unexpected Ubuntu
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 = -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 syntax error at line 1 (' unexpected in shell script 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 was not using bash, can't believe i missed something so obvious... it's embarrassing actually:( –Crazywiz Wiz Jul 30 '13 at 11:00 3 This question appears to be off-topic because it is about fixing a trivial syntax error that would be best marked as 'unlikely to be of use to future visitors' but that rea
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Syntax Error At Line Unexpected
workings and policies of this site About Us Learn more about syntax error ( unexpected bash array Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions ksh syntax error unexpected 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. http://stackoverflow.com/questions/17944710/how-to-fix-bin-sh-syntax-error-unexpected-without-changing-to-bin-bash Join them; it only takes a minute: Sign up getting error /bin/sh: 1: Syntax error: “(” unexpected up vote 0 down vote favorite I want to run the following script from python: temp=$(sky2xy image.fits 124.6456 -2.5517); arr=(${temp// / }); For that I am using the os.system() module: import os os.system('temp=$(sky2xy image.fits 124.6456 -2.5517); arr=(${temp// / });') But I am http://stackoverflow.com/questions/31075438/getting-error-bin-sh-1-syntax-error-unexpected getting an unexpected syntax error sh: 1: Syntax error: "(" unexpected 512 The error is due to the parenthesis used in arr=(${temp// / }) How should I get rid of this error? python shell unix share|improve this question edited Jun 26 '15 at 14:17 hitzg 4,760625 asked Jun 26 '15 at 14:12 Aalok_G 354 1 You're trying to do bash-specific stuff using sh. This is almost certainly a duplicate. –Tom Fenech Jun 26 '15 at 14:14 I would suggest that you do the minimum amount of work in the shell (i.e. sky2xy image.fits 124.6456 -2.5517), save the result in python and manipulate it from there. –Tom Fenech Jun 26 '15 at 14:22 I am actually trying to use Image magick, hence I am using the commandline. The complete script is as follows temp=$(sky2xy img.fits 124.6456 -2.5517); arr=(${temp// / }); X=${arr[4]};Y=${arr[5]}; convert -quiet img.fits -level 7.26470947266%,7.85173086528% -negate -fill transparent -stroke red -draw "circle $X,$Y echo $X+5|bc,$Y" -stroke black -draw "rectangle echo $X-12|bc,echo $Y-12|bc echo $X+12|bc,echo $Y+12|bc" -crop 50x50+echo $X-25|bc+echo $Y-25|bc\! -backgroun
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 This http://www.linuxquestions.org/questions/programming-9/bin-sh-syntax-error-unexpected-906697/ 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 http://superuser.com/questions/544093/shell-script-works-directly-but-has-a-syntax-error-via-crontab Community. You 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 syntax error access many other special 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 1 syntax error contact us. If you need to reset your password, 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: Syn
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 Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. 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 Shell script works directly, but has a syntax error via crontab up vote 1 down vote favorite 1 I have a shell script to automate a git commit and push every night: auto_git_push.sh #!/bin/sh function automate(){ git add . 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 (set to every minute for testing) * * * * * sh /home/hookedonwinter/bin/auto_git_push.sh I get the following error: /home/hookedonwinter/bin/auto_git_push.sh: 3: Syntax error: "(" unexpected What is causing this syntax error? Thanks! Edit based on accepted answer: Changed the script to: #!/bin/bash automate() { git add . git commit -am "automated push $(date +"%Y-%m-%d")" git push -u } cd ~/htdocs automate And the crontab line to: * * * * * /bin/bash /home/hookedonwinter/bin/auto_git_push.sh shell crontab share|improve this question edited Jan 30 '13 at 19:20 asked Jan 30 '13 at 18:30 hookedonwinter 277139 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted As John mentioned, it is a matter of your script being interpreted differently in the two environments (using /bin/sh under cron, and using your existing shell, which is probably /bin/bash when you source it in directly). Actually, /bin/sh is usually just a symlink to /bin/bash, and the bash executable behaves differently depending on the name under which it was invoked, but that's just an aside. Here, the easiest way to fix your issue is probably just to specify /bin/bash /home/hookedonwinter/bin/auto_git_push.sh as the command to run under cr