Bin/sh 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 bin sh c line 1 syntax error unexpected end of file more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Syntax Error End Of File Unexpected Expecting Then
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, syntax error end of file unexpected (expecting done ) helping each other. Join them; it only takes a minute: Sign up /bin/sh: Syntax Error: end of file unexpected up vote 2 down vote favorite I am getting an error when running the following makefile with make -f
Java Syntax Error: End Of File Unexpected (expecting ")")
makefile2 install (apart install the rest is working): all:myapp #which compiler CC = gcc #Where to install INSTDIR = /usr/local/bin #where are include files kept INCLUDE = . #Options for development CFLAGS = -g -Wall -ansi #Options for release # CFLAGS = -O -Wall -ansi myapp: main.o 2.o 3.o $(CC) -o myapp main.o 2.o 3.o main.o: main.c a.h $(CC) -I$(INCLUDE) $(CFLAGS) -c main.c 2.o: 2.c a.h b.h $(CC) -I$(INCLUDE) $(CFLAGS) -c 2.c 3.o: 3.c b.h c.h android studio syntax error: "(" unexpected (expecting $(CC) -I$(INCLUDE) $(CFLAGS) -c 3.c clean: -rm main.o 2.o 3.o install: myapp @if [ -d $(INSTDIR) ]; \ then \ cp myapp $(INSTDIR);\ chmod a+x $(INSTDIR)/myapp;\ chmod og-w $(INSTDIR)/myapp;\ echo "Installed in $(INSTDIR)";\ else echo "Sorry, $(INSTDIR) does not exist";\ fi I'm getting the following error: error /bin/sh: 7: Syntax error: end of file unexpected make: *** [install] Error 2 From what I understand it is a white space/tabulation/non unix character problem in the last lines of the makefile (after install:). But even trying to delete all spaces and replacing with tabulation I didn't manage to run the makefile properly. The code comes directly from a programming book I'm reading and is an example. Any help appreciated! linux makefile share|improve this question asked Jan 29 '13 at 0:24 Étienne 3,11911541 Why not [ -d $(INSTDIR) ] || mkdir -p $(INSTDIR}? Most users would expect that behavior. –William Pursell Jan 29 '13 at 0:32 Well, the code is only illustrating explanations about using shell in a makefile from the programming book, they probably just wanted to show this syntax, but thank you for the piece of advice. –Étienne Jan 29 '13 at 0:36 add a comment| 1 Answer 1 active oldest votes up vote 8 down vote accepted You're missing a trailing slash on your else under the install rule. It should be
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
Aapt: Syntax Error: End Of File Unexpected (expecting ")")
site About Us Learn more about Stack Overflow the company Business Learn more
Syntax Error: "fi" Unexpected (expecting
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x syntax error unexpected expecting fi ubuntu Dismiss Join the Stack Overflow 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 Syntax error: http://stackoverflow.com/questions/14573694/bin-sh-syntax-error-end-of-file-unexpected 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 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 http://stackoverflow.com/questions/18155852/syntax-error-end-of-file-unexpected-expecting-then [ ! -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 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. &ndash
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community https://ubuntuforums.org/showthread.php?t=1838432 Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation http://askubuntu.com/questions/618260/script-sh-syntax-error 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 Forum Community Ubuntu Official Flavours Support General Help [SOLVED] bash - expecting "fi" but syntax error 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 page: Results 1 to 10 of 21 Thread: bash - expecting "fi" but it is already there Thread Tools Show Printable Version end of file 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 Ubuntu-Restricted-Extras ..." apt-get -y install ubuntu-restricted-extras echo "done" sleep 5 echo "Installation des VLC-Players ..." echo "--------------------------------" apt-get -y install vlc vlc-data echo "done" sleep 5 echo "Hinzufuegen der PPA: Paketquellen fuer SUN JAVA, Handbrake und bumblebee ..." echo "---------------------------------------------------------------------------" add-apt-repository ppa:ferramroberto/java add-apt-repository ppa:stebbins/handbrake-re
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 script sh syntax error [closed] up vote 1 down vote favorite I have this script: #!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi When I try to run it, this is the outcome: $ sh /home/pi/sh/test.sh /home/pi/sh/test.sh: 9: /home/pi/sh/test.sh: Syntax error: "fi" unexpected (expecting "then") Where is the problem? command-line bash scripts sh share|improve this question edited May 4 '15 at 19:12 0xF2 2,04621538 asked May 4 '15 at 18:40 Kwiatkowski 91 closed as off-topic by muru, Fabby, David Foerster, Registered User, Eric Carvalho May 6 '15 at 23:29 This question appears to be off-topic. The users who voted to close gave this specific reason:"This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – muru, Fabby, David Foerster, Registered User, Eric CarvalhoIf this question can be reworded to fit the rules in the help center, please edit the question. Add the output of file /home/pi/sh/test.sh. I cannot reproduc