public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: jensen@adobe.com (Freddy Jensen)
To: cygwin@cygwin.com
Cc: jensen@adobe.com
Subject: tcsh problems with Cygwin on 64-bit Windows Server 2008
Date: Mon, 05 Jan 2009 22:11:00 -0000	[thread overview]
Message-ID: <090105115048.ZM835@adobe.com> (raw)


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@adobe.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/

             reply	other threads:[~2009-01-05 19:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 22:11 Freddy Jensen [this message]
2009-01-07 15:52 ` Corinna Vinschen
2009-01-07 17:53   ` Christopher Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=090105115048.ZM835@adobe.com \
    --to=jensen@adobe.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).