This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Solving: Quotes in $PATH not translated properly

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'.
> 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 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
      . /etc/profile
      cd "$cwd"

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:
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:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]