From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pop-a065d23.pas.sa.earthlink.net ([207.217.121.254]) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1DRAKR-0007JM-00 for ; Thu, 28 Apr 2005 10:49:23 -0400 Received: from user-10ib9c5.biz.mindspring.com ([65.37.165.133] helo=bruzos) by pop-a065d23.pas.sa.earthlink.net with esmtp (Exim 3.36 #10) id 1DRAKP-0006iF-00 for speakup@braille.uwo.ca; Thu, 28 Apr 2005 07:49:21 -0700 Received: by bruzos (Postfix, from userid 501) id 3715F10039; Thu, 28 Apr 2005 10:49:21 -0400 (EDT) Date: Thu, 28 Apr 2005 10:49:21 -0400 From: David Bruzos To: "Speakup is a screen review system for Linux." Message-ID: <20050428144920.GA10329@bruzos.org> References: <20050428140324.GA20658@rednote.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050428140324.GA20658@rednote.net> User-Agent: Mutt/1.4.1i Subject: Re: Bash Problem X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 14:49:24 -0000 Hi Janina: Could it be that you are missing the declaration of the "$i" variable. I added it and it worked for me. This is what I got: #!/bin/bash for i in $(ls); do if [ "$i" != "incoming/" ]; then echo "$i" fi done It seems as if you are missing the "i" after the "for". HTH David B. On Thu, Apr 28, 2005 at 10:03:25AM -0400, Janina Sajka wrote: > I'm confused over some simple bash syntax. If I write the following at > the bash (ver 3.0) prompt, all works as expected--no errors. > > But, if I execute from a script file (which begins with a #!/bin/bash of > course), I get: > > line 4: syntax error near unexpected token `then' > > What am I missing? All help much appreciated. > > > for in $( ls); do > if [ "$i" != "incoming/" ]; then > echo $i > fi > done > > > -- > > Janina Sajka Phone: +1.202.494.7040 > Partner, Capital Accessibility LLC http://www.CapitalAccessibility.Com > > Chair, Accessibility Workgroup Free Standards Group (FSG) > janina@freestandards.org http://a11y.org > > If Linux can't solve your computing problem, you need a different problem. > > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup