Hot Network Questions Difficulties interpreting this complex sentence How to properly localize numbers? Will a tourist have any trouble getting money from an ATM India because of demonetization? asked 2 years ago viewed 7277 times active 2 years ago Get the weekly newsletter! What do you do with all the bodies? http://netlookmag.com/syntax-error/syntax-error-word-unexpected-expecting-makefile.html
Make up your mind. asked 2 months ago viewed 42 times active 2 months ago Related 2211Check if a directory exists in a shell script760How do I prompt for Yes/No/Cancel input in a Linux shell Eating Skittles Like a Normal Person Will majority of population dismiss a video of fight between two supernatural beings? Letter of Recommendation Without Contact from the Student VT-x is not available, but is enabled in BIOS Bounce off the atmosphere at reentry?
more stack exchange 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 Grass grows through the floor of my building Ordering a bulky item in the USA Resubmitting elsewhere without any key change when a paper is rejected What are some counter-intuitive results Edit: It also occurred to me that this could be made much easier - find has a delete option: Code: find $path/*.xls -mtime +1 -delete Adv Reply April 21st, 2009 You can easily confirm this is with a simple example: # #!/bin/bash offfset=(`ls`) echo $offset Running this script with sudo will raise a syntax error in recent versions of Ubuntu and
Adv Reply April 21st, 2009 #5 mister_pink View Profile View Forum Posts Private Message Quad Shot of Ubuntu Join Date Oct 2007 Beans 441 Re: Syntax error: word unexpected (expecting But it's working very strange. I am getting this error when I tried running the script. Syntax Error Unexpected Word Expecting What does "put on one's hat" mean?
Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. And anyway, if you can't solve the problem with the information in this thread, ask a new question with the full content of the script and copy-paste the full error message(s). Square root image filter tool in Python Display a Digital Clock What are some counter-intuitive results in mathematics that involve only finite objects? You're now being signed in.
more stack exchange 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 You have two options to make sure the script is interpreted by bash: Move the shebang to the first line Run sudo like this: sudo bash ./pi_dev_env_install.sh share|improve this answer answered Syntax Error Word Unexpected (expecting ) ) Shell Script Mar 30 '11 at 21:28 add a comment| up vote 0 down vote Give this a try: #!/bin/sh while [ true ] do echo "WTF" done Please pay special attention to Unexpected Expecting Done Last edited by rohandeshmukh; April 21st, 2009 at 06:28 AM.
Was running wrong arch executable. http://netlookmag.com/syntax-error/syntax-error-near-unexpected-token-shell-script.html Is it still safe to drive? Adv Reply Quick Navigation New to Ubuntu Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums The Ubuntu Forum Community Ubuntu Official Flavours Support New Will a tourist have any trouble getting money from an ATM India because of demonetization? Syntax Error Done Unexpected
Not the answer you're looking for? I set the permissions to 777 and +x so it should work with the 'sh' command, right... So I started experimenting by removing all the sudo lines and running the whole script via sudo at the command line like so: [email protected]:~$ sudo ./pi_dev_env_install.sh This works fine as expected Check This Out Top For discussions on Ubuntu please visit the Linux - General Discussions group.
Try to move the shebang in line 1. –manatwork Aug 18 '12 at 11:45 According to that article calling /bin/bash directly instead of /bin/sh will; correctly use bash instead While Loop Bash I can still move the shebang of course, but that doesn't really explain as to why it works when you donâ€™t sudo the whole script. –kemra102 Aug 18 '12 at 11:50 Schengen visa to Norway to visit my wife refused Plus and Times, Ones and Nines Am I being a "mean" instructor, denying an extension on a take home exam more hot
Still getting the error. –soufrk Sep 1 at 6:58 @soufrk Is it sonarqube.sh or sonar.sh? How do I reassure myself that I am a worthy candidate for a tenure-track position, when department would likely have interviewed me even if I wasn't? forcing power off." if [ $TEST -eq 0 ]; then vim-cmd vmsvc/power.off $SRVID fi sleep $WAIT_TIME fi fi } # enter maintenance mode immediately echo "Entering maintenance mode..." if [ $TEST Toolbox for IT My Home Topics People Companies Jobs White Paper Library Collaboration Tools Discussion Groups Blogs Follow Toolbox.com Toolbox for IT on Twitter Toolbox.com on Twitter Toolbox.com on Facebook Topics
How to construct a 3D 10-sided Die (Pentagonal trapezohedron) and Spin to a face? How should I tell my employer? Browse other questions tagged bash shell ubuntu shell-script or ask your own question. this contact form But I get the following error: syntax error: unexpected "(" I tried a few things but nothing worked.
The situation is: Me having a UPS and wanting to get a script which shuts down my VM's and afterwards shuts down the Host if the UPS starts running. The loop it looks ok. –Radu RÄƒdeanu Sep 3 '13 at 8:32 I run it with the sh command: sh script.sh –user568021 Sep 3 '13 at 8:36 Try entering it through vi, as it may end up being some character encoding / line feeds in your script. –dotalchemy Mar 30 '11 at 20:06 Weirdly your first Why do the Avengers have bad radio discipline?
French vs Italian resistance Does enlarging a character with a reach weapon affect his threat range? Solve problems - It's Free Create your account in seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. Since dash (like all other shells) is an interpreter, it won't complain until the execution reaches the problematic line. Script without personal changes: #!/bin/sh # ESXi 5.1 host automated shutdown script # these are the VM IDs to shutdown in the order specified # use the SSH shell, run "vim-cmd
rather than dbuser=$DROPBOX_USERS share|improve this answer edited Apr 6 '14 at 10:47 answered Apr 6 '14 at 10:41 Michael Tomkins 745 Downvote for patronizing people who have a different Join Date Apr 2008 Location Campinas, SP - Brasil Beans 355 Re: Syntax error: word unexpected (expecting "do") Put this in the first line of your script file: #!/bin/sh This sets It's confusing. All product names are trademarks of their respective companies.
Eating Skittles Like a Normal Person Is including the key as AAD actually dangerous? Not the answer you're looking for? How to Use Oracle (20) - B-tree indexes GO-ing Office to extend Data Governance For discussions on Ubuntu please visit the Linux - General Discussions group. anyways, Thanks for your help!
Word that includes "food, alcoholic drinks, and non-alcoholic drinks"? Reportremoval.sh: 5: Syntax error: word unexpected (expecting "do") Please give me some suggestion. Adding the shebang line solved it immediately. +1. –bkd.online Oct 9 '13 at 5:14 Facing the issue running sonarqube.sh on Ubuntu 15.10.