Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <896908DA55C4D311B9C000C04F01A05410A6E2@ENTERPRISE> From: Harold Hunt To: "Cygx (E-mail)" , "'cygwin AT sources DOT redhat DOT com'" Subject: bash [ -f filename ] behavior Date: Sun, 1 Oct 2000 22:54:28 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" When building XFree86 from CVS under Cygwin you may encounter a problem where 'make World' reports that a file 'imake' cannot be moved because it does not exist. I have looked into this problem extensively, and it is due to bash behaving differently under Cygwin than it does under Linux. However, I believe it deserves to at least be brought to light. Make a bash script file containing the following line: if [ -f imake ]; then mv imake imake.foo; fi Follow these steps under Cygwin's Bash: Run the script in a directory with no files named imake or imake.exe. The script will detect that imake does not exist, so it will not attempt to move the file. Run 'touch imake', then run the script again. The script will move file imake to imake.foo, as it should. Run 'touch imake.exe', then run the script again. The script will think that a file named 'imake' exists, even though it doesn't; the script will then attempt to move file 'imake', which does not exist, and the script will fail. Now, run the same steps under Linux's Bash, and you'll notice that the script does not get confused when a file named 'imake.exe' exists. This bug, or feature (as it may help compatibility), currently causes XFree86 to fail when building under Cygwin. I'm going to send in a patch to XFree86 to check for 'imake.exe' before checking for 'imake'; that will fix the build bustage for now. But, I figure the Cygwin guys might want to evaluate whether this is really desired behavior... (I'm not on the Cygwin list, just the Cygwin/XFree86 list, so Cygwin people please CC me. Thanks.) Harold -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com