Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Mon, 24 Feb 2003 09:24:25 -0800 (PST)
From: Michael A Chase <mchase@ix.netcom.com>
Subject: Re: Solving: Quotes in $PATH not translated properly
To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>,
   Harald Kierer <Harald.Kierer@astrum.de>
Message-ID: <Mahogany-0.64.2-1324-20030224-092425.00@ix.netcom.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-Disposition: INLINE
References: <8C6D4989662C304087C58904BAB721A54B73D4@Hermes.astrum.de>
In-Reply-To: <8C6D4989662C304087C58904BAB721A54B73D4@Hermes.astrum.de>

On Mon, 24 Feb 2003 17:22:54 +0100 Harald Kierer <Harald.Kierer@astrum.de> wrote:

> a current problem when invoking cygwin is: if the Windows PATH
> variable has quoted paths then cygwin won't translate those paths to
> POSIX properly, so you end up with an incomplete $PATH:
> 
> T:\bin>echo %PATH%
> "C:\Program Files\abc";[...]

Are the quotes absolutely necessary inside %path%?  If not, removing
them would be a useful workaround.

> So when I start a login bash everything is nice:
> 
> T:\src>bash --login
> 
> [/t/src] $ echo $PATH
> /usr/local/bin:/usr/bin:/bin:/c/Program Files/abc:[...]

> My remaining problem:
> We launch a lot of scripts from the DOS Box, like 'sh script.sh'.
> This doesn't invoke the profile. How can I launch this path-parser-script
> every time a bash or ash gets started?

Just like you show above, with --login.  -rcfile is also possible.
One problem with doing either blindly is that /etc/profile might
change the current directory.  See
http://home.ix.netcom.com/~mchase/zip/Bash_This.reg for some example
"one liners" that work around that problem.

If the scripts expect to be called from a DOS prompt, something like
the following inside them might help:

   if [ -z "$PS1" ]; then
      cwd="$PWD"
      . /etc/profile
      cd "$cwd"
   fi

It would be easier to launch your scripts from a normal bash prompt
if at all possible.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

