X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63 X-Spam-Check-By: sourceware.org From: jensen AT adobe DOT com (Freddy Jensen) Message-Id: <090105115048.ZM835@adobe.com> Date: Mon, 5 Jan 2009 11:50:48 -0800 Reply-To: X-No-Archive: yes To: cygwin AT cygwin DOT com Subject: tcsh problems with Cygwin on 64-bit Windows Server 2008 Cc: jensen AT adobe DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I just finished setting up my new 64-bit Windows Server 2008 machine. One of the final things was to install cygwin on the machine so I could get all the Unix functionality. However, I ran into a problem when launching the tcsh shell. I got this error: "Badly placed ()'s", and the shell stopped reading the startup file. I have tracked this down to one element of the PATH environment variables, namely this one: /cygdrive/c/Program Files ( x86 ) /Microsoft ...." What happens is that on 64 bit WinServ-2008 the installers for various programs put native 64-bit applications into C:\Program Files\... and 32-bit applications into C:\Program Files ( x86 ) \... and the installers then add the path into the environment variables for the user. When you start a CMD window then the DOS command inherits all the env vars, including the PATH variable and then when you launch the tcsh it first reads this file: /etc/profile.d/lapack.csh Inside that file there is a loop that evaluates each path element and it finally chokes on "/cygdrive/c/Program Files ( x86 ) /Microsoft ...." because the parens have special meaning to tcsh unless they are escaped. In my opinion it is a bug in cygwin's /etc/profile.d/lapack.csh profile script. Work-around: After a little fiddling I found out how to work around this problem without having to modify the cygwin file: /etc/profile.d/lapack.csh: The only thing that lapack.csh does is to add /usr/lib/lapack to the path if it is not already there. So instead of hacking up /etc/profile.d/lapack.csh I just added this line to my tcsh batch startup file: set PATH= Of course, then I have to make sure that all the other required paths get added back in so that the tcsh can function correctly. So basically my Cygwin-tcsh.bat script looks like this now: --------------------------------------------------------------------- @echo off C: chdir C:\cygwin\bin set HOME=//picard2/jensen rem Clear PATH to prevent tcsh from choking on "Program Files (x86)" rem in the file: c:\cygwin\etc\profile.d\lapack.csh set PATH= tcsh -i --------------------------------------------------------------------- where "picard2" is my samba server that connect me to my Unix home dir. Then in my $HOME/.cshrc file I set up the path like this: set path = \ ( $HOME/bin \ My own shell scripts $HOME/bin/ix86win32 \ My own win and batch scripts /usr/local/bin \ Part of cygwin installation /usr/bin \ Part of cygwin installation /bin \ Part of cygwin installation /usr/X11R6/bin \ Part of cygwin installation /usr/sbin \ Part of cygwin installation /sbin \ Part of cygwin installation /usr/lib/lapack \ Part of cygwin installation /cygdrive/c/Windows/system32 \ Cmd batch scripts for WinServ-08 /cygdrive/c/Windows \ Cmd batch scripts for WinServ-08 /cygdrive/c/WINDOWS/system32 \ Cmd batch scripts for Windows-XP /cygdrive/c/WINDOWS \ Cmd batch scripts for Windows-XP /cygdrive/c/Programs/Sysinternals ) Where I installed the Sysinternals Suite Notice that the comments after each backslash are not present in my .cshrc, otherwise the '\' wouldn't work correctly. Of course, long term, it would be desirable to have a better solution that is less of a hack. I am open for suggestions. Thanks -- Freddy Jensen, Sr. Computer Scientist, Adobe Systems Incorporated 345 Park Avenue, San Jose, CA 95110-2704, USA, Ph: (408) 536-2869 Email: jensen AT adobe DOT com, URL: http://www.adobe.com -- -- 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/