Cygwin compatibility Questions

Earnie Boyd earnie_boyd@yahoo.com
Mon May 31 21:10:00 GMT 1999


--- flawlor@us.ibm.com wrote:
> 
> 
> I have some scripts that need to run under many shells and tried them under
> Cygwin.
> I ran into a couple of problems.
> 
> 1) The scripts launch a task to run some DB2 commands (db2cmd db2 ...).
> Since these run asynchronously, the scripts monitor the db2 process
> (db2sysc*)
> to determine when it is done.  Under Cygwin, the ps command doesn't seem to
> show most processes, even those I launch.  What do I need to do to be able to
> see them?

The cygwin ps command only maintains processes started by the cygwin product. 
The cygwin product has an internal table of it's processes and cannot map the
processes started by non-cygwin products.


> 
> 2) The scripts need to cd to other directories (on other disks) during
> operation.
> The general technique used is basically:
> 
>    oldDir=`pwd`
>    cd <somewhere>
>    ...
>    cd $oldDir
> 
> In Cygwin, the paths don't seem to have an drive letters, so when the target
> is
> a different drive, the cd fails.  I found that I can use cygpath, e.g.
> 
>    oldDir=`pwd`
>    if [ "$OSTYPE" = "cygwin32" ]; then
>       oldDir=`cygpath -w $oldDir`
>    fi
>    ...
>    cd $oldDir
> 

Why are you doing this?  Why do you need the cygpath portion?


-8<-
> 3) Similar to the above, the scripts need to invoke other scripts, commands,
> etc.
> on other paths:
> 
>    ${somepath}/command
> 
> This has the same problem with the default paths as above when the
> command is on a different drive.  Using cygpath to convert the path
> still doesn't work (I get 'not found").  I found that I need to convert the
> '\'s to '/' to get it to work:
> 
>    thePath=`pwd`
>    thePath=`cygpath -w $thePath | tr \\\\\\\\ /`
>    ...
> 

It sounds to me as if the pwd you're executing isn't the one supplyed by
cygwin.  Make sure that the cygwin/bin directory is first in the PATH list.


> 
> A general comment.  I've tried these scripts on numerous shells.
> One of the critical elements of shells is their handling of Window's paths.
> If my understanding, above, is correct, then Cygwin handling of paths

I don't think that your understanding is correct.  The Cygwin product handles
paths rather smartly.  You can do any of the following:

cd c:/some/where/else
cd c:\\some\\where\\else
cd //c/some/where/else
If C:\\ is mounted as / then you can
cd /some/where/else
If C:\\ is mounted as /c then you can
cd /c/some/where/else

If you don't understand what I mean by "mounted as" then you need to read the documentation.
===
"Earnie Boyd" < mailto:earnie_boyd@yahoo.com >
CYGWIN RELATED HELP:
 DOCUMENTATION: < http://sourceware.cygnus.com/cygwin/docs.html >
       DLLHELP: < http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ >
ARCHIVE SEARCH: < http://www.delorie.com/archives/ > OR
                < http://www.eGroups.com/list/gnu-win32/ >
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com




More information about the Cygwin mailing list