Makefile Syntax Error End Of File Unexpected Expecting Fi
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 Learn more about Stack Overflow the company Business Learn java syntax error: end of file unexpected (expecting ")") more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags syntax error: "fi" unexpected (expecting Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, aapt: syntax error: end of file unexpected (expecting ")") helping each other. Join them; it only takes a minute: Sign up Syntax error : end of file unexpected (expecting “fi”) up vote 7 down vote favorite 1 I am writing a makefile in bash and I syntax error unexpected expecting fi ubuntu have a target in which I try to find if a file exists and even though I think the syntax is correct, i still gives me an error. Here is the script that I am trying to run read: if [ -e testFile] ; then \ cat testFile\ fi I am using tabs so that is not a problem. The error is (when I type in: "make read") if [ -e testFile] ; then \ cat
Android Studio Syntax Error: "(" Unexpected (expecting
testFile \ fi /bin/sh: Syntax error: end of file unexpected (expecting "fi") make: *** [read] Error 2 bash makefile share|improve this question edited Apr 24 '09 at 19:26 ephemient 118k26178303 asked Apr 19 '09 at 5:48 Jaelebi 1,46362129 add a comment| 3 Answers 3 active oldest votes up vote 11 down vote accepted Try adding a semicolon after cat testFile. For example: read: if [ -e testFile ] ; then cat testFile ; fi alternatively: read: test -r testFile && cat testFile share|improve this answer edited Mar 25 '11 at 23:42 Julien Roncaglia 12.5k13667 answered Apr 19 '09 at 6:01 jwa 16113 1 the alternate solution works but I have to use the if..then syntax. adding a semicolon does not seem to solve the issue. –Jaelebi Apr 19 '09 at 6:09 Weird. I tried it the first time with semicolon and it didnt work. th second time I ran it it worked.Thanks –Jaelebi Apr 19 '09 at 6:14 Just a note to self: I originally wrote plain multiline bash statements in the makefile, and had the same failure - and as this answer notes, the trick is to have the makefile recognize the shell command as a single line; hence I'd need both semicolon ; (to separate shell commands) and backslash `\` (to escape the subsequent newline) to get it
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
Sh: 1: Syntax Error: End Of File Unexpected
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss makefile loop over files Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only makefile for loop takes a minute: Sign up Syntax error: end of file unexpected (expecting “then”) up vote 1 down vote favorite 2 I am making this code for a minecraft server plugin updater I am a new shell scripter so I don't http://stackoverflow.com/questions/764908/syntax-error-end-of-file-unexpected-expecting-fi know alot... when I run this code I get a error: #!/bin/sh export PATH=$PATH:. #Options PLUGINDOWNLOADLINK=http://api.bukget.org/3/plugins/bukkit/$PLUGINNAME/latest/download # Plugin folder if [ -f $PWD\plugins ]; then PLUG=$PWD\plugins else PLUG=$PWD\plug-ins fi cd $PLUG if [ ! -f .\update ]; then mkdir update echo Making Directory "update".. fi # Plugins Found for i in $( ls ); do PLUGINNAME=$i done cd .\update wget $PLUGINDOWNLOADLINK # No Plugins Found if [ ! -f $PLUG ]; then echo echo echo No plugin found. echo echo echo http://stackoverflow.com/questions/18155852/syntax-error-end-of-file-unexpected-expecting-then echo Plugins can be downloaded here: echo http://dev.bukkit.org/bukkit-plugins fi # stop sleep 3s exit I get this error: Syntax error: end of file unexpected (expecting "then") so I put "then" in the place it wanted me to and ran it again: it gave me this error now: Syntax error: end of file unexpected I wrote it on windows 7 notepad++ how can I fix this? linux shell unix minecraft share|improve this question edited Aug 9 '13 at 21:43 asked Aug 9 '13 at 21:22 user2649805 13115 The code you posted does not cause the error. –choroba Aug 9 '13 at 21:26 then what does? –user2649805 Aug 9 '13 at 21:27 or have you composed this script in a Windows-based editor, and then copied it you your linux server without running dos2unix myPluginScript. ? Good luck. –shellter Aug 9 '13 at 21:34 ya exept it is a pi –user2649805 Aug 9 '13 at 21:35 dos2unix does not work –user2649805 Aug 9 '13 at 21:39 | show 1 more comment 2 Answers 2 active oldest votes up vote 3 down vote accepted I have met the same problem. And the problem is the format of the file is "dos", but in linux shell requires "unix", so I install the "dos2unix" $ sudo apt-get install dos2unix or if you use emacs, you can do this: C-x RET f unix Good luck :) share|improve th
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get https://ubuntuforums.org/showthread.php?t=1838432 UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support http://superuser.com/questions/253099/dont-know-why-this-small-shell-script-wont-work/253101 Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu syntax error Forum Community Ubuntu Official Flavours Support General Help [SOLVED] bash - expecting "fi" but it is already there Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Page 1 of 3 123 Last Jump to end of file page: Results 1 to 10 of 21 Thread: bash - expecting "fi" but it is already there Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode September 3rd, 2011 #1 SeaKing View Profile View Forum Posts Private Message A Carafe of Ubuntu Join Date Jul 2011 Location Germany Beans 88 DistroUbuntu 12.04 Precise Pangolin bash - expecting "fi" but it is already there I've wrote a little bash script to ease the installation of programs which are not part of the standard installation of ubuntu: Code: #! /bin/bash #installing ubuntu-restricted-extras vlc, SUN Java, handbrake, bumblebee (hybrid graphics management tool), skype, pidgin, Thunderbird echo "" echo "" echo "Willkommen bei der Installationsroutine fuer das Asus X5MSN" echo "------------------------------------------------------------" echo "" if [ "$(whoami)" != "root" ]; then echo "Das Script muss mit root-Rechten ausgefuehrt werden!" echo "Nutze: 'sudo ./script.sh'" echo "" else echo "Installation der Ubu
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 Don't know why this small shell script wont work up vote 2 down vote favorite I'm trying to make a small script to start up gunicorn for a python website I'm making. I have modified the script found at https://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc slightly. Here's my version. #!/bin/sh GUNICORN=/usr/local/bin/gunicorn ROOT=/srv/mobile-site/app PID=/var/run/gunicorn.pid APP=mobilecms:app if [ -f $PID ]; then rm $PID fi cd $ROOT exec $GUNICORN -b 127.0.0.1:8080 -w 8 -k gevent --pidfile=$PID $APP When I try to run the script though, it shows this error /etc/init.d/gunicorn: 13: Syntax error: end of file unexpected (expecting "fi") Does anyone know what's wrong? bash ubuntu-10.04 shell share|improve this question asked Mar 4 '11 at 6:20 tominated 1133 add a comment| 1 Answer 1 active oldest votes up vote 7 down vote accepted You need a semi-colon between rm $PID and fi. Like this: if [ -f $PID ]; then rm $PID; fi The semi-colons are essentially shorthand so you can put this small if statement on a single line. Without them it would look like this: if [ -f $PID ] then rm $PID fi share|improve this answer answered Mar 4 '11 at 6:28 Jed Daniels 962612 that fixed it! thanks! –tominated Mar 4 '11