public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Fw: 1.7.9-1 path issues
@ 2011-10-14 20:36 David Bartlett
  2011-10-14 21:08 ` Jeremy Bopp
  0 siblings, 1 reply; 2+ messages in thread
From: David Bartlett @ 2011-10-14 20:36 UTC (permalink / raw)
  To: cygwin

Hi,

I have been searching for three days now for an answer to my issue and am 
only posting here as a last resort.

Recently I updated from a thinkpad T61 to a T410 and installed cygwin on 
it exactly as I had on the T61. The only
difference was that on the T61 I had an older version of cygwin installed 
(I'm not sure which one but it would have been
from around mid 2009).

Both laptops have Windows XP installed and Oracle 10G Express Edition.

in my .profile i have my HOME variable set as HOME=/home/dcbartlett

I have other variables set up in my profile that take the HOME value as a 
root.

DC_ROOT=$HOME/bcystage/app/xform/DC_Scripts; export DC_ROOT
DC_ERROR=$DC_ROOT/log; export DC_ERROR
DC_REFRESH_MSG_FILE="$DC_ERROR/refresh_msgs.txt"; export 
DC_REFRESH_MSG_FILE;

I have unix scripts that use those variables and they call sqlplus which 
in turn uses those variables in spool commands.

The issue is that the logging the unix scripts perform works but the 
spooling from sqlplus does not.
If I change the HOME variable to HOME=C:/cygwin/home/dcbartlett the unix 
logging no longer
works but sqlplus spooling does.  In both cases I get file not found 
messages.

Setting HOME to C:/cygwin/home/dcbartlett worked for both unix and sqlplus 
on my old laptop (with the older version
of cygwin). And I don't recall doing anything funky to get that to work. 

Does anyone have any idea on how I can resolve this without having to 
create one set of 
variables for Oracle and one for Unix. I am not sure if this is a cygwin 
issue or an 
oracle issue.


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fw: 1.7.9-1 path issues
  2011-10-14 20:36 Fw: 1.7.9-1 path issues David Bartlett
@ 2011-10-14 21:08 ` Jeremy Bopp
  0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Bopp @ 2011-10-14 21:08 UTC (permalink / raw)
  To: cygwin

On 10/14/2011 15:33, David Bartlett wrote:
> Recently I updated from a thinkpad T61 to a T410 and installed cygwin on 
> it exactly as I had on the T61. The only
> difference was that on the T61 I had an older version of cygwin installed 
> (I'm not sure which one but it would have been
> from around mid 2009).
> 
> in my .profile i have my HOME variable set as HOME=/home/dcbartlett
> 
> I have other variables set up in my profile that take the HOME value as a 
> root.
> 
> DC_ROOT=$HOME/bcystage/app/xform/DC_Scripts; export DC_ROOT
> DC_ERROR=$DC_ROOT/log; export DC_ERROR
> DC_REFRESH_MSG_FILE="$DC_ERROR/refresh_msgs.txt"; export 
> DC_REFRESH_MSG_FILE;
> 
> I have unix scripts that use those variables and they call sqlplus which 
> in turn uses those variables in spool commands.
> 
> The issue is that the logging the unix scripts perform works but the 
> spooling from sqlplus does not.
> If I change the HOME variable to HOME=C:/cygwin/home/dcbartlett the unix 
> logging no longer
> works but sqlplus spooling does.  In both cases I get file not found 
> messages.
> 
> Setting HOME to C:/cygwin/home/dcbartlett worked for both unix and sqlplus 
> on my old laptop (with the older version
> of cygwin). And I don't recall doing anything funky to get that to work. 
> 
> Does anyone have any idea on how I can resolve this without having to 
> create one set of 
> variables for Oracle and one for Unix. I am not sure if this is a cygwin 
> issue or an 
> oracle issue.

This is neither an Oracle nor a Cygwin issue.  Cygwin programs usually
expect and sometimes require Cygwin paths while Windows-native programs,
such as sqlplus, always require Windows paths.

Since your previous Cygwin version (likely in the 1.5.x series), many
changes have been made to how Cygwin handles paths.  The Cygwin
developers never promised that Windows would work with Cygwin tools.
They never attempted to break things intentionally, but it seems you've
been bit by using a bad assumption about path compatibility.

Without seeing your scripts and how they use the variables for their
logging tasks, no one can really say much about what specifically you
can do.  Generally though, don't mix Windows paths with your Cygwin
tools and never mix Cygwin paths with your Windows tools.

I can think of 2 options for your situation:

1) Use relative paths everywhere.
2) Write wrapper functions or scripts for all your Windows-native
programs that get called with these paths.

The first may not work for you if you need to hop around within various
working directories while ensuring that the paths still refer to the
same location.  If you can ensure that your scripts always run all
programs from within a single directory though, this is the easiest
option since you probably won't have to perform any path conversions.

If the first option is not possible, you can wrap all calls to the
Windows-native programs in either functions or shell scripts.  The
wrappers would then be responsible for processing all paths given to
them with cygpath in order to make them something usable by the
Windows-native programs that they call directly.  This will localize the
places where you perform conversions without the need to carry two
versions of every variable containing a path through your scripts.

-Jeremy

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-14 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14 20:36 Fw: 1.7.9-1 path issues David Bartlett
2011-10-14 21:08 ` Jeremy Bopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).