I have my share of cases where the script complain at line 150 and the problem as on a misquote in a completed different line. –BitsOfNix Aug 24 '15 at 7:25 Is the partition function of non-conformal theories on a torus modular invariant? Please click the link in the confirmation email to activate your subscription. Tips like this are very helpful as I really want to improve my bash scripting knowledge. Source
If bad lineend's are not the case then I can't help. Complimenting the author of a textbook Will majority of population dismiss a video of fight between two supernatural beings? This site is not affiliated with Linus Torvalds or The Open Group in any way. You have put me on the right track. :) –mhulse Feb 24 at 7:34 add a comment| Did you find this question interesting?
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 sjsam's advice to use shellcheck is good, but the short version is that you should be using square brackets instead of round ones on the internal brackets of your if statement: If I put a semicolon like in your example, I get a syntax error!
Use dos2unix or something similar to get rid of those. – devnull devnull is spot-on. Cheers. This site is not affiliated with Linus Torvalds or The Open Group in any way. Syntax Error Near Unexpected Token Done' While Loop share|improve this answer answered Aug 7 '14 at 6:40 tripleee 61.1k864119 add a comment| up vote 2 down vote for is an internal function (not to be confused with functions) of
UNIX is a registered trademark of The Open Group. Syntax Error Near Unexpected Token Do Mac If you'd like to contribute content, let us know. And I think you want an explicit path to the file in your remove command. (If you have a script with references to a particularly long path or one that is Anyway, here's my quick rewrite: #!/bin/bash # $1 is the first parameter passed # $2 is the second parameter passed # $3 is the third parameter passed for file in *.*;
Thanks Anthony. Linux Unexpected Token Do Problem solved Thanks, -- -Andrew Louie :wq -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple References: cygwin64 - bash: syntax error near unexpected token `X86' From: Andrew Louie LinuxQuestions.org > Forums > Non-*NIX Forums > Programming Bash script problem: syntax error near unexpected token `do User Name Remember Me? Change syntax of macro, to go inside braces how to match everything between a string and before next space split strings and add them as new row Word that includes "food,
Registration is quick, simple and absolutely free. Thank you for you help!!! Syntax Error Near Unexpected Token Do For Loop The bash just retrieves the data. Syntax Error Near Unexpected Token Do In Unix Are there too few Supernova Remnants to support the Milky Way being billions of years old?
Search this Thread 08-15-2011, 06:52 AM #1 rmaier9 LQ Newbie Registered: Aug 2011 Posts: 2 Rep: Bash script problem: syntax error near unexpected token `do Hello, I am having http://netlookmag.com/unexpected-token/unexpected-token-error-in-r.html Why does MIT have a /8 IPv4 block? Hit a curb today, taking a chunk out of the tire and some damage to the rim. Any recommendations as to how to fix or improve the script would be nice too. Do Unexpected In Shell Script
This can only be caused by a carriage return following do. If they are, the script converts such files to the type of the third parameter using an FFMPEG command. I don't understand some of the error messages well on shellcheck. http://netlookmag.com/unexpected-token/syntax-error-near-unexpected-token-39-bash.html UNIX is a registered trademark of The Open Group.
asked 9 months ago viewed 692 times active 9 months ago Related 0Shell script - syntax error near unexpected token `['5While command not found and syntax error near unexpected token4syntax error Syntax Error Near Unexpected Token Do R Feynman diagram and uncertainty Bounce off the atmosphere at reentry? Next, the way you're replacing the file's extension won't work right.
Success! I have yet to get the quitting part figured out completely, but before I can do that, I need to get past this do statement error. UNIX is a registered trademark of The Open Group. Syntax Error Near Unexpected Token ' In Shell Script Hope this helps.
Word for nemesis that does not refer to a person Close current window shortcut An electronics company produces devices that work properly 95% of the time Did millions of illegal immigrants The Failing code snippet is as following: [...] while read line do insert_into_table="insert into isam_subrack_tbl (select neId, friendlyName, eqptHolderActualType from $line)" $MYSQL_HOME/bin/mysql --socket=/tmp/mysql.sock -u$MYSQL_USER -p$MYSQL_PWD --host $MYSQL_HOST -Demlplatform -e "$insert_into_table" done To confirm its proper working you can also, check with different folder name to be present, e.g LOG_1. http://netlookmag.com/unexpected-token/syntax-error-near-unexpected-token-newline-39-doctype-html-39.html 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
Idiomatic Expression that basically says "What's bad for you is good for me" Hit a curb today, taking a chunk out of the tire and some damage to the rim. I would execute the script with the following command: ./convert.sh .avi .mp4 .flv That this, this script would convert all of the .avi and .mp4 files to .flv. split strings and add them as new row Should a country name in a country selection list be the country's local name? In the video we are using ( and not [ here is the correct line which is used in the video (while true; do echo -n "my program" >> ~/output.file; sleep