can not find valid cygwin path

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

can not find valid cygwin path

lin q
Hi,
   I have the latest cygwin installed on WinXP SP1. It works fine in general
until I try to run some program today.

  It is really weired, the program requiring setting up some environment
viriables, I guess iniside its code it tries to find some data based on that
variable setting. Anyway, I do it something like this in my script,

export PROG_ENV=/cygdrive/c/prog
export PATH=$PROG_ENV/bin/nt:$PATH

echo $PATH
$PROG_ENV/bin/nt/prog.exe


  Then I source this script in cygwin, but I get such error,

The PROG_ENV directory "/cygdrive/c/prog" does not exist.
The PROG_ENV environment variable does not point to any directories.  
Current setting is PROG_ENV="/cygdrive/c/prog".

  But if I `ls $PROG_ENV`, the directory is there! And `cd  $PROG_ENV` works
also.

  I wonder why the valid cygwin can not be taken.

  Another thing I find is if I change the BASH script to DOS script and run
it directly from dos, then everything is ok, namingly here is the DOS scipt,

set PROG_ENV=c:\prog
set PATH=%PROG_ENV%\bin\nt;%PATH%

%PROG_ENV%\bin\nt\prog.exe

  Any suggestion?

_________________________________________________________________
Don?t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


--
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/

Reply | Threaded
Open this post in threaded view
|

Re: can not find valid cygwin path

Christopher Faylor-2
On Tue, Nov 01, 2005 at 10:04:01AM -0700, lin q wrote:

>Hi,
>  I have the latest cygwin installed on WinXP SP1. It works fine in general
>until I try to run some program today.
>
> It is really weired, the program requiring setting up some environment
>viriables, I guess iniside its code it tries to find some data based on
>that variable setting. Anyway, I do it something like this in my script,
>
>export PROG_ENV=/cygdrive/c/prog
>export PATH=$PROG_ENV/bin/nt:$PATH
>
>echo $PATH
>$PROG_ENV/bin/nt/prog.exe
>
>
> Then I source this script in cygwin, but I get such error,
>
>The PROG_ENV directory "/cygdrive/c/prog" does not exist.
>The PROG_ENV environment variable does not point to any directories.  
>Current setting is PROG_ENV="/cygdrive/c/prog".
>
> But if I `ls $PROG_ENV`, the directory is there! And `cd  $PROG_ENV` works
>also.

Sounds like prog.exe isn't a cygwin program and doesn't understand /cygdrive
style paths.

> I wonder why the valid cygwin can not be taken.
>
> Another thing I find is if I change the BASH script to DOS script and run
>it directly from dos, then everything is ok, namingly here is the DOS scipt,
>
>set PROG_ENV=c:\prog
>set PATH=%PROG_ENV%\bin\nt;%PATH%
>
>%PROG_ENV%\bin\nt\prog.exe
>
> Any suggestion?

Yep.  That pretty much clinches it.  Don't use cygdrive with pure windows
programs.

cgf

--
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/

Reply | Threaded
Open this post in threaded view
|

RE: can not find valid cygwin path

Dave Korn
In reply to this post by lin q
lin q wrote:

> Hi,
>    I have the latest cygwin installed on WinXP SP1. It works fine in
> general until I try to run some program today.
>
>   It is really weired, the program requiring setting up some environment
> viriables, I guess iniside its code it tries to find some data based on
> that variable setting. Anyway, I do it something like this in my script,
>
> export PROG_ENV=/cygdrive/c/prog
> export PATH=$PROG_ENV/bin/nt:$PATH
>
> echo $PATH
> $PROG_ENV/bin/nt/prog.exe
>

  Woops.  That's wrong already.  $PROG_ENV should have been expanded in
"export PATH=" command, so "echo $PATH" should not show "$PROG_ENV/.." but
"/cygdrive/c/prog/bin/nt....", as below:

--------------------------------<snip!>--------------------------------
dk@espanola ~> echo $PATH
/artimi/swtools/windows/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/win/c
/W
INDOWS/system32:/win/c/WINDOWS:/win/c/WINDOWS/System32/Wbem:/artimi/chips/ness
/b
in:/win/c/Modeltech_6.0d/win32:/win/c/Modeltech_6.0d/win32pe:/win/c/WINDOWS/sy
st
em32:/win/c/WINDOWS:/win/c/WINDOWS/System32/Wbem:/usr/bin
dk@espanola ~> cat foo.sh
#!/bin/bash
export PROG_ENV=/cygdrive/c/prog
export PATH=$PROG_ENV/bin/nt:$PATH
echo $PATH

dk@espanola ~> . foo.sh
/cygdrive/c/prog/bin/nt:/artimi/swtools/windows/bin:/usr/local/bin:/usr/bin:/b
in
:/usr/X11R6/bin:/win/c/WINDOWS/system32:/win/c/WINDOWS:/win/c/WINDOWS/System32
/W
bem:/artimi/chips/ness/bin:/win/c/Modeltech_6.0d/win32:/win/c/Modeltech_6.0d/w
in
32pe:/win/c/WINDOWS/system32:/win/c/WINDOWS:/win/c/WINDOWS/System32/Wbem:/usr/
bi
n
dk@espanola ~>
--------------------------------<snip!>--------------------------------

  What shell are you using?

    cheers,
      DaveK
--
Can't think of a witty .sigline today....


--
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/

Reply | Threaded
Open this post in threaded view
|

RE: can not find valid cygwin path

lin q
>From: "Dave Korn" <[hidden email]>
>To: <[hidden email]>
>Subject: RE: can not find valid cygwin path
>Date: Tue, 1 Nov 2005 17:16:28 -0000
>
>lin q wrote:
> > Hi,
> >    I have the latest cygwin installed on WinXP SP1. It works fine in
> > general until I try to run some program today.
> >
> >   It is really weired, the program requiring setting up some environment
> > viriables, I guess iniside its code it tries to find some data based on
> > that variable setting. Anyway, I do it something like this in my script,
> >
> > export PROG_ENV=/cygdrive/c/prog
> > export PATH=$PROG_ENV/bin/nt:$PATH
> >
> > echo $PATH
> > $PROG_ENV/bin/nt/prog.exe
> >
>
>   Woops.  That's wrong already.  $PROG_ENV should have been expanded in
>"export PATH=" command, so "echo $PATH" should not show "$PROG_ENV/.." but
>"/cygdrive/c/prog/bin/nt....", as below:
>
>--------------------------------<snip!>--------------------------------
>dk@espanola ~> echo $PATH
>/artimi/swtools/windows/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/win/c
>/W
>INDOWS/system32:/win/c/WINDOWS:/win/c/WINDOWS/System32/Wbem:/artimi/chips/ness
>/b
>in:/win/c/Modeltech_6.0d/win32:/win/c/Modeltech_6.0d/win32pe:/win/c/WINDOWS/sy
>st
>em32:/win/c/WINDOWS:/win/c/WINDOWS/System32/Wbem:/usr/bin
>dk@espanola ~> cat foo.sh
>#!/bin/bash
>export PROG_ENV=/cygdrive/c/prog
>export PATH=$PROG_ENV/bin/nt:$PATH
>echo $PATH
>
>dk@espanola ~> . foo.sh
>/cygdrive/c/prog/bin/nt:/artimi/swtools/windows/bin:/usr/local/bin:/usr/bin:/b
>in
>:/usr/X11R6/bin:/win/c/WINDOWS/system32:/win/c/WINDOWS:/win/c/WINDOWS/System32
>/W
>bem:/artimi/chips/ness/bin:/win/c/Modeltech_6.0d/win32:/win/c/Modeltech_6.0d/w
>in
>32pe:/win/c/WINDOWS/system32:/win/c/WINDOWS:/win/c/WINDOWS/System32/Wbem:/usr/
>bi
>n
>dk@espanola ~>
>--------------------------------<snip!>--------------------------------
>
>   What shell are you using?
>
>     cheers,
>       DaveK
>--

I do not quite get what you are saying and your example, I am using BASH
which the default cygwin shell.

In your example you can see that "/cygdrive/c/prog/bin/nt" is the first
element in $PATH, that is what we want; "$PROG_ENV/bin/nt/prog.exe" is
expanded to "/cygdrive/c/prog/bin/nt/prog.exe" correctly.

These are all as expected, the problem is why the correct path can not be
taken.

Do I miss anything?

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


--
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/

Reply | Threaded
Open this post in threaded view
|

RE: can not find valid cygwin path

Dave Korn
lin q wrote:
>> From: "Dave Korn" <dave.korn@artimiAAAARRRRGGGHHHHHH!>

  Oh no.  More spam.  :-(

  Please read http://cygwin.com/acronyms#PCYMTNQREAIYR!

> I do not quite get what you are saying and your example, I am using BASH
> which the default cygwin shell.

  Hmm, maybe I don't quite get what you are saying then!

> In your example you can see that "/cygdrive/c/prog/bin/nt" is the first
> element in $PATH, that is what we want; "$PROG_ENV/bin/nt/prog.exe" is
> expanded to "/cygdrive/c/prog/bin/nt/prog.exe" correctly.

  Yes, that is what I think is supposed to happen.

> These are all as expected, the problem is why the correct path can not be
> taken.
>
> Do I miss anything?

  Yes:  Why is _your_ example different from mine?  Look:
 
>>> export PROG_ENV=/cygdrive/c/prog
>>> export PATH=$PROG_ENV/bin/nt:$PATH
>>>
>>> echo $PATH
>>> $PROG_ENV/bin/nt/prog.exe


  Here, PROG_ENV is *not* expanded.  So something has gone wrong, hasn't it?  


    cheers,
      DaveK
--
Can't think of a witty .sigline today....


--
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/