waspsoft.com


Home > Syntax Error > Bash Script Syntax Error Near Unexpected Token Do

Bash Script Syntax Error Near Unexpected Token Do

Contents

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 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 How to deal with a very weak student? How to pluralize "State of the Union" without an additional noun? this contact form

Why did companions have such high social standing? The Bourne and Korn shell found on Solaris allow unmatched quotes especially backticks for instance (while other shells are stricter on that). Here is the code: #!/bin/bash # $1 is the first parameter passed # $2 is the second parameter passed # $3 is the third parameter passed for file in *.*; do Browse other questions tagged bash shell-script scripting or ask your own question.

Linux Syntax Error Near Unexpected Token Then'

Much appreciated. :) –mhulse Feb 25 at 0:46 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook 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 asked 4 months ago viewed 147 times active 4 months ago Related 2882Can a Bash script tell which directory it is stored in?1Bash Shell Script error: syntax error near unexpected token

Also, notice that you should quote your variables: wget --no-check-certificate --directory-prefix="${tempFolder}" "${i}" share|improve this answer edited Oct 28 '15 at 7:18 answered Oct 28 '15 at 6:54 chaos 27.4k65095 The time now is 08:47 PM. - Contact Us - Unix & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top Religious supervisor wants to thank god in the acknowledgements Meaning of "soul-sapping" How to increase the population growth of the human race Now I know my ABCs, won't you come and Syntax Error Near Unexpected Token Do R share|improve this answer answered Feb 24 at 6:27 CodeGnome 2,8461619 1 Ahh, that makes sense now!

errorCount=0 while read filename do echo "$filename" if [ -s $filename ] then tail -10 $filename | grep date '+%Y-%m-%d' >> $lastlines1 echo "- Next Error File - " >> $lastlines1 Linux Syntax Error Near Unexpected Token Newline' Can filling up a 75 gallon water heater tank without opening a faucet cause damage? Browse other questions tagged bash unix ffmpeg or ask your own question. while read filename do echo "$filename" if [ -s $filename ] then tail -10 $filename | grep date '+%Y-%m-%d' >> $lastlines1 echo "- Next Error File - " >> $lastlines1 else

Not the answer you're looking for? Syntax Error Unexpected Do Skeletal formula for carbon with two double bonds Is there a way to make a metal sword resistant to lava? dos2nix T.sh Install the 'dos2unix' rpm if 'dos2unix' returns a 'command not found' message. Share it with others to increase its visibility and to get it answered quickly.

Linux Syntax Error Near Unexpected Token Newline'

UNIX is a registered trademark of The Open Group. Changed your mind? Linux Syntax Error Near Unexpected Token Then' What does the "Phi" sign stand for in musical notation? Syntax Error Near Unexpected Token Do For Loop Not the answer you're looking for?

The time now is 07:47 PM. http://waspsoft.com/syntax-error/bash-array-syntax-error-near-unexpected-token.html asked 11 months ago viewed 769 times active 11 months ago Related 1/shell-script: syntax error near unexpected token `done'2command not found and syntax error near unexpected token2Bash : syntax error near Log In Sign Up Report a Bug Use this form to report bugs related to the Community Unix & Linux Forums > Top Forums > Shell Programming isn't it ? –Rahul Patil Jan 2 '13 at 12:34 It depends a lot on the user's environment. Syntax Error Near Unexpected Token Do Mac

Activate Hearthstone season chest cards? How does Gandalf get informed of Bilbo's 111st birthday party? When taking passengers, what should I do to prepare them? navigate here Meaning of Guns and ghee How to extrude a face parallel to another?

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 Syntax Error Near Unexpected Token In Shell Script 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: for file in *.*; do #comparing the file types in the directory to the first 2 parameters passed if [ ${file: -4} == "$1" ] || [ ${file: -4 } ==

Why did companions have such high social standing?

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. Log In to Comment 4 Answers 0 sianios May 18, 2014 Replace : with ; See here for more examples http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html Reply Log In to Comment 0 dinhhoangviet May 18, 2014 Search this Thread 08-15-2011, 05: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 Unexpected End Of File Bash How to book a flight if my passport doesn't state my gender?

asked 3 years ago viewed 9434 times active 2 years ago Related 4Shell Script - syntax error near unexpected token `else'2command not found and syntax error near unexpected token2bash: syntax error 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 How to map and sum a list fast? http://waspsoft.com/syntax-error/bash-for-syntax-error-near-unexpected-token.html Not the answer you're looking for?

UNIX is a registered trademark of The Open Group. no outgoing connection via ipv4 Least Common Multiple Which requires more energy: walking 1 km or cycling 1 km at the same speed? 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 This site is not affiliated with Linus Torvalds or The Open Group in any way.

Which requires more energy: walking 1 km or cycling 1 km at the same speed? Is 8:00 AM an unreasonable time to meet with my graduate students and post-doc? Unix & Linux Stack Exchange works best with JavaScript enabled current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. Why are some programming languages Turing complete but lack some abilities of other languages?

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 If bad lineend's are not the case then I can't help. Remove advertisements Sponsored Links mkukantha View Public Profile Find all posts by mkukantha

Page 1 of 4 1 234 > « Previous Thread | Next Thread » Thread Tools Show 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

How to deal with a really persuasive character? What could cause the throttle to stick in my Ford Ranger? praju1 View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by praju1 Thread Tools Show Printable Version Email this Page Search this Thread Advanced 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

If I put a semicolon like in your example, I get a syntax error!