delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/24/12:23:00

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

On Mon, 24 Feb 2003 17:22:54 +0100 Harald Kierer <Harald DOT Kierer AT astrum DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019