y/n; read yn; if [ $yn = y ]; then exit; fi; donespace after the opening square bracked and space before the closing square bracket.semicolon must be immediately after the while You can also leave off the ; and move the do/then on to the next line but I consider that unnecessarily wasteful of screen real estate. What does an 'ü' mean? UNIX is a registered trademark of The Open Group.
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 current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. Anyway, at a new terminal prompt I replaced 'exit' with 'return', and learned that:bash: return: can only `return' from a function or sourced script(I got out with ^c)So now my test Not the answer you're looking for?
How to increase the population growth of the human race I do not get any ether when mining no outgoing connection via ipv4 Skeletal formula for carbon with two double bonds Forum Operations by The UNIX and Linux Forums This is symptomatic of unexpected CR characters in the text file. Bash Syntax Error Near Unexpected Token Done' Join them; it only takes a minute: Sign up Syntax error in while loop BASH up vote 1 down vote favorite I'm trying to run a loop that will run matlab
Is the following extension of finite state automata studied? Skipping directly to level 4 How to extrude a face parallel to another? Did Donald Trump call Alicia Machado "Miss Piggy" and "Miss Housekeeping"? The other semi-colons are redundant but harmless. –chepner Jul 26 at 13:43 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google
How does Gandalf get informed of Bilbo's 111st birthday party? Bash Syntax Error Near Unexpected Token Else' What bash are you using? y/n: " yorn if [ $yorn == "y" ] ; then echo "'$ff' is being overwitten" elif [ $yorn == "n" ] ; then echo "Let's try this again..." bool="true" else restarting..." done However, that being said-- none of that will cause an error.
Join them; it only takes a minute: Sign up Bash while loop syntax error in do up vote 0 down vote favorite I´m trying do do a simple counter: max=100 count=1 Try with only -x to see where it first stops to make sense. Bash While No Error However, this is preferred in Bash: while ((i <= p)); do # $i>i.txt # this line doesn't make any sense matlab -nojvm -r 'readtxt_abc;pause(1);myfunc1(a,b,c);clear' & # there's no need to pipe Android Shell Script Syntax Error Do The Bourne and Korn shell found on Solaris allow unmatched quotes especially backticks for instance (while other shells are stricter on that).
Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... learn unix and linux commands While loop error: Unexpected token this content Please help. System Information" echo "5. Not the answer you're looking for? Python While Loop Syntax Error
How to book a flight if my passport doesn't state my gender? Subtraction with a negative result Which requires more energy: walking 1 km or cycling 1 km at the same speed? bash while-loop share|improve this question edited Jun 11 '14 at 17:04 Zefnus 3,26431942 asked Oct 11 '12 at 13:33 AWE 1,12371734 1 see my post, need an extra space –Gilles http://onlinetvsoftware.net/syntax-error/bash-syntax-error-bad-for-loop-variable.php Will the medium be able to last 100 years?
Is there a good way to get from Levoča to Lviv? Bash Syntax Error Near Unexpected Token Fi' Hardware Utilization" echo "Which option do you require?" read menunumber case $menunumber in 1) echo "USER INFORMATION" echo "1. 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 increase the population growth of the human race A simple visual puzzle to die for Realism of a setting with several sapient anthropomorphic animal species more hot questions question Hope the file for example with vim and enable the syntax check. My script is like: #!/bin/sh FILENAME=$1 while read line do if [[$line = *sometext*]] then echo $line fi done < $FILENAME And I get the error: line 5: syntax error near Bash Syntax Error Invalid Arithmetic Operator share|improve this answer edited May 28 '12 at 8:20 answered May 28 '12 at 8:11 Dennis Williamson 167k42235305 the i.txt line relates to something, just ignore it.
Why write an entire bash script in functions? I understood.
There are several blocks that would be easier to read if they were indented. –Bryan Oakley Jul 23 '15 at 19:44 1 you are missing a fi after echo "'$ff' tr -cd '[:graph:]\n\t '
Success! At first I didn't remember –DonCallisto May 28 '12 at 8:26 ok thanks DonCallisto –jarhead May 28 '12 at 8:27 add a comment| up vote -2 down vote I Can Customs make me go back to return my electronic equipment or is it a scam? Browse other questions tagged bash while-loop or ask your own question.
What to tell to a rejected candidate? What type of sequences are escape sequences starting with "\033]" Why are some programming languages Turing complete but lack some abilities of other languages? Browse other questions tagged linux bash shell while-loop virtualbox or ask your own question. Is the standard Canon 18-55 lens the same as 5 years ago?
What does the "Phi" sign stand for in musical notation? Member Posts: 448 Re: bash "while" loop [SOLVED] « Reply #3 on: December 11, 2014, 04:23:31 PM » QuoteAlso, depending on the context you may want to use "return" or "break"