This is the mail archive of the
mailing list for the Cygwin project.
Re: [Re: Another problem; Bash]
- To: <sandman at Interwoven dot com>, <jason at tishler dot net>
- Subject: Re: [Re: Another problem; Bash]
- From: <mxgl at usa dot net>
- Date: 14 Aug 2001 20:17:02 MET DST
- CC: Cygwin <cygwin at sources dot redhat dot com>
Sandeep Tamhankar <sandman@Interwoven.com> wrote:
> This is all true; but if you want to use /bin/sh (a.k.a. ash) and run
> the script, change the 'let' line to the following:
> i=`/usr/bin/expr $i + 1`
> That way, it doesn't matter which shell you're running your script in.
> Jason Tishler wrote:
> > In the future, please post to the Cygwin mailing list instead of sending
> > private email so others can benefit too. This is especially true after
> > email such as the following:
> > On Fri, Jul 20, 2001 at 10:46:42PM +0200, email@example.com wrote:
> >>Jason Tishler <Jason.Tishler@dothill.com> wrote:
> >>>Please use Cygwin's setup.exe to install (all of) Cygwin. Otherwise,
> >>>it is inappropriate to ask for help on the mailing list.
> >> You will probably allow me to use the above remark as a highly
> >>instructive illustration of what I would call, to put it mildly, patent
> >>inawareness of argumentative circularity, if you do not, I will be no
> >>thankful for your quick and immediate help, with hindsight, of course, I
> >>should seriously have weighed alternative options first, before bothering
> >>You, ... it will never happen again ...
> > Hmm...
> > Anyway, on to your most recent problem.
> > On Fri, Aug 03, 2001 at 01:36:32PM +0200, firstname.lastname@example.org wrote:
> >>I have run into another problem, I have been able to pinpoint it, but
> >>come up with a solution.
> >>When I write the line "let i=$i+1" into a scriptfile and try to execute
> >>get the message "let: Not found",
> > Does the script start with "#! /bin/sh"? If so, then your problem is
> > that ash (i.e., /bin/sh under Cygwin) does not support "let".
> >>if I execute the same file as dotscript ". scriptfile", I get no error
> > The above works because bash is processing the script instead of ash
> > even if it contains the "#! /bin/sh" trigger line.
> >>it seems no RESERVED WORDS are recognized in scriptfile, if not run as
> > Not true, other keywords such as "for" are recognized by ash -- just not
> > "let" (and possibly other bash keywords).
> >>Is this standard behaviour of bash under cygwin, or is it a problem.
> > This is standard Cygwin ash behavior and IMO, is not a problem.
> > Jason
> Sandeep V. Tamhankar
> Member of Technical Staff
> Tel: (408) 220-7505
> Fax: (408) 774-2002
> Email: email@example.com
> Visit http://www.interwoven.com
> Moving Business to the Web
Many thanks for your immediate help, Jason and Sandeep,
I get the point, I did not use any COMMAND INTERPRETER LINE in my script,
assuming that this was only necessary, if I wanted it to be interpreted by AWK
or PERL, in any ohter case I expected it to executed by the DEFAULT $SHELL,
which is "bash".
So commands entered on the command line are always executed by $SHELL, scripts
however if not explicitly specified ohterwise are executed by ash, which on
the one hand creates less overhead, but as a consequence does not "understand"
Executed as a dot script, the script is executed as if executed on the command
line and as consequence interpreted by bash.
Many thanks again, I really would not have able to solve this without your
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html