From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from concerto.rednote.net ([66.92.170.139]) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1DRAkY-0007yA-00 for ; Thu, 28 Apr 2005 11:16:22 -0400 Received: from concerto.rednote.net (localhost.localdomain [127.0.0.1]) by concerto.rednote.net (8.13.1/8.13.1) with ESMTP id j3SFGJ0n026139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 28 Apr 2005 11:16:20 -0400 Received: (from janina@localhost) by concerto.rednote.net (8.13.1/8.13.1/Submit) id j3SFGJRk026138 for speakup@braille.uwo.ca; Thu, 28 Apr 2005 11:16:19 -0400 Date: Thu, 28 Apr 2005 11:16:19 -0400 From: Janina Sajka To: "Speakup is a screen review system for Linux." Message-ID: <20050428151619.GD20658@rednote.net> Mail-Followup-To: "Speakup is a screen review system for Linux." References: <20050428140324.GA20658@rednote.net> <20050428144920.GA10329@bruzos.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050428144920.GA10329@bruzos.org> User-Agent: Mutt/1.4.1i X-Operating-System: Linux concerto.rednote.net 2.6.10-1.770_FC3spksmp Organization: Capital Accessibility LLC (http://www.CapitalAccessibility.com) X-PGP-Key: http://www.CapitalAccessibility.com/JaninaSajka_gpg_key.html 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 15:16:22 -0000 Yeah, David. I typed into the email by hand and did indeed forget the declaration. But, it was in the actually test.sh file I wrote. David Bruzos writes: > 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 > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup -- 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.