From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gscodenh01.cr.usgs.gov ([136.177.7.10]) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1DRDm1-0002Zh-00 for ; Thu, 28 Apr 2005 14:30:05 -0400 Received: from PUNK ([130.118.172.119]) by gscodenh01.cr.usgs.gov (Lotus Domino Release 6.5.2) with SMTP id 2005042812292412-248511 ; Thu, 28 Apr 2005 12:29:24 -0600 Message-ID: <005601c54c20$2f63c7e0$77ac7682@azwaterDOM.wr.usgs.gov> From: "Sean McMahon" To: "Speakup is a screen review system for Linux." References: <20050428140324.GA20658@rednote.net> <20050428144920.GA10329@bruzos.org> Date: Thu, 28 Apr 2005 11:29:16 -0700 MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-MIMETrack: Itemize by SMTP Server on gscodenh01/SERVER/USGS/DOI(Release 6.5.2|June 01, 2004) at 04/28/2005 12:29:24, Serialize by Router on gscodenh01/SERVER/USGS/DOI(Release 6.5.2|June 01, 2004) at 04/28/2005 12:30:04, Serialize complete at 04/28/2005 12:30:04 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" Subject: Re: Bash Problem X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sean McMahon , "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 18:30:06 -0000 So bash does work the same way as sh does, in that she is also missing the double quote around the echo statement. single quotes for echo statements without variables, double quotes for echo statements with variables. I'd like to point out for portability, I always use sh instead of bash. You can probably give the script the -x argument to debug it. ----- Original Message ----- From: "David Bruzos" To: "Speakup is a screen review system for Linux." Sent: Thursday, April 28, 2005 7:49 AM Subject: Re: Bash Problem > 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