Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: flawlor AT us DOT ibm DOT com X-Lotus-FromDomain: IBMUS To: cygwin AT sourceware DOT cygnus DOT com Message-ID: <85256768.0052746D.00@d54mta08.raleigh.ibm.com> Date: Wed, 5 May 1999 10:00:40 -0500 Subject: Cygwin compatibility Questions Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline 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? 2) The scripts need to cd to other directories (on other disks) during operation. The general technique used is basically: oldDir=`pwd` cd ... 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 but this means significant Cygwin specific changes to the scripts and an increased likelihood of errors. Very undesirable. Is there some modal way (e.g., CYGWIN environment variable setting) to get paths in "windows" format? 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 \\\\\\\\ /` ... ${thePath}/command What is the proper Cygwin way to ensure that I will get paths that resolve correctly? The above requires too much cygwin-specific code. 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 will cause serious incompatibilities with other shells. This doesn't seem to be inherent to GNU since other GNU-based shells don't have these problems. Thanks in advance for any help, -- Frank Lawlor IBM, Austin -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com