X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <f60fe000804070520q53519fb6x8ebd1c033fc46b7@mail.gmail.com>
Date: Mon, 7 Apr 2008 08:20:39 -0400
From: "Mark J. Reed" <markjreed@mail.com>
To: cygwin@cygwin.com
Subject: Re: Getting started with bash
In-Reply-To: <D9C5C745FD957899B39D7759@192.168.1.20>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <1207553471.24669.ezmlm@cygwin.com> <47F9DA5E.3060904@hollo.dk> 	 <D9C5C745FD957899B39D7759@192.168.1.20>
X-Google-Sender-Auth: 5648158296a3bf29
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

You hit the nail on the head with the environment vars question.  Bash
tries to do the minimum amount of work possible when invoked
non-interactively, on the assumption - almost universally true in *NIX
- that it is being invoked by a process (usually another shell) that
has its environment all set up already.  So when that's not the case,
you need to tell bash so by adding the "-l" or "--login" option, so it
will go out and read login-oriented startup files ([bash_]profile)  to
set up its own environment.



On 4/7/08, Joel M. Baldwin <qumqats@outel.org> wrote:
>
> --On Monday, April 07, 2008 10:25 AM +0200 Michael Holm <hollo@hollo.dk>
> wrote:
>
> > Hi,
> >
> > I have read a lot of documents, but i really cant get this issue solved :(
> > All i want is to be able to execute bash scripts from a windows
> > desktop.. what i do now is..
> >
> >
> > a batch script:
> > c:\cygwin\bin\bash c:\cygwin\example.sh
> >
> > this is my bash script.
> >
> > example.sh
> > ls -l
> >
> >
> > but i get the following output:
> > command not found.
> >
> > i hope that someone can give me a hit... all i have done is:
> > install cygwin, made my batch script.. and made my bash script.. do i
> > need to set any environment vars or something?
> >
> > mvh
> > Michael Holm
>
> Add the -l option to bash.
> i.e. "man bash" for an explanation
>
> This makes it a login shell which must cause the PATH variable to be set.
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

-- 
Sent from Gmail for mobile | mobile.google.com

Mark J. Reed <markjreed@mail.com>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

