public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Will Parsons <wbp@nodomain.invalid>
To: cygwin@cygwin.com
Subject: tcsh path conversion messed up? [was: strange shell output using tcsh under Cygwin]
Date: Mon, 06 Nov 2017 21:48:00 -0000	[thread overview]
Message-ID: <otqlbj$91n$1@blaine.gmane.org> (raw)
In-Reply-To: <oto9is$k56$1@blaine.gmane.org>

I asked about what I thought was a shell scripting problem:

Will Parsons wrote:
> Under Unix-type platforms, checking on what the PATH variable is set to is
> pretty easy - I typically use "env" and the displayed value of PATH is easily
> parsed by eye.  Under Cygwin/Windows, one can do the same, but the value of
> PATH is more likely to be considerably more complicated and harder for a
> human to parse.  For example, this is what I see on my local machine under
> Cygwin:
>
>    PATH=/usr/local/bin:/usr/bin:/c/Windows/system32:/c/Windows:/c/Windows/system32/wbem:/c/ProgramData/Oracle/Java/javapath:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/c/Program Files/Dell/DW WLAN Card:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files/WIDCOMM/Bluetooth Software:/c/Program Files/WIDCOMM/Bluetooth Software/syswow64:/c/Program Files (x86)/Windows Live/Shared:/c/Program Files (x86)/Bazaar:/c/Program Files (x86)/QuickTime/QTSystem:/c/cygwin/home/william/bin:/c/ezwinports/bin:/c/Program Files (x86)/PuTTY:/usr/lib/lapack:/usr/sbin:/c/msys/1.0/local/bin

This was a cut/paste, so I would be sure of not making a mistake.  The PATH
looks completely reasonable to me, but...

> I thought it would be nice to write a simple script to make this more
> comprehensible by breaking the path into separate lines, and so wrote the
> following trivial script:
>
>    #!/bin/sh
>    echo $PATH | tr ':' '\n'
>
> Oddly though, it does not give the expected results under Cygwin.  Running
> this script under Cygwin under my normal interactive script (tcsh) yields the
> following:
>
>    % ./path
>    /usr/local/bin
>    /usr/bin
>    /bin
>    /usr/sbin
>    /c/Windows/system32
>    /c/Windows
>    /c/Windows/system32/wbem
>    /c/ProgramData/Oracle/Java/javapath
>    /c/Program
>    Files/Common
>    Files/Microsoft
>    Shared/Windows
>    Live
>    /c/Program
>    Files
>    (x86)/Common
>    Files/Microsoft
>    Shared/Windows
>    Live
>    /c/Program
>    Files/Dell/DW
>    WLAN
>    Card
>    /c/Program
>    Files
>    (x86)/Intel/iCLS
>    Client
>    /c/Program
>    Files/Intel/iCLS
>    Client
>    /c/Windows/System32/WindowsPowerShell/v1.0
>    /c/Program
>    Files/WIDCOMM/Bluetooth
>    Software
>    /c/Program
>    Files/WIDCOMM/Bluetooth
>    Software/syswow64
>    /c/Program
>    Files
>    (x86)/Windows
>    Live/Shared
>    /c/Program
>    Files
>    (x86)/Bazaar
>    /c/Program
>    Files
>    (x86)/QuickTime/QTSystem
>    /c/cygwin/home/william/bin
>    /c/ezwinports/bin
>    /c/Program
>    Files
>    (x86)/PuTTY
>    /usr/lib/lapack
>
> Clearly the path is being broken using spaces as well as colons.
>
> Even thoush the shell script itself explicitly specifies "/bin/sh", the
> result seems to depend on the shell being used to invoke it.  Using Cugwin
> bash, the same script results in the following:
>
>    sothis$ ./path
>    /usr/local/bin
>    /usr/bin
>    /c/Windows/system32
>    /c/Windows
>    /c/Windows/system32/wbem
>    /c/ProgramData/Oracle/Java/javapath
>    /c/Program Files/Common Files/Microsoft Shared/Windows Live
>    /c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live
>    /c/Program Files/Dell/DW WLAN Card
>    /c/Program Files (x86)/Intel/iCLS Client
>    /c/Program Files/Intel/iCLS Client
>    /c/Windows/System32/WindowsPowerShell/v1.0
>    /c/Program Files/WIDCOMM/Bluetooth Software
>    /c/Program Files/WIDCOMM/Bluetooth Software/syswow64
>    /c/Program Files (x86)/Windows Live/Shared
>    /c/Program Files (x86)/Bazaar
>    /c/Program Files (x86)/QuickTime/QTSystem
>    /c/cygwin/home/william/bin
>    /c/ezwinports/bin
>    /c/Program Files (x86)/PuTTY
>    /usr/lib/lapack
>    /usr/sbin
>    /c/msys/1.0/local/bin

I have just rebooted my Windows machine and see that in constrast to what I
wrote above, the value of PATH under tcsh shows up as:

   PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/c/Windows/system32:/c/Windows:/c/Windows/system32/wbem:/c/ProgramData/Oracle/Java/javapath:/c/Program:Files/Common:Files/Microsoft:Shared/Windows:Live:/c/Program:Files:(x86)/Common:Files/Microsoft:Shared/Windows:Live:/c/Program:Files/Dell/DW:WLAN:Card:/c/Program:Files:(x86)/Intel/iCLS:Client:/c/Program:Files/Intel/iCLS:Client:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program:Files/WIDCOMM/Bluetooth:Software:/c/Program:Files/WIDCOMM/Bluetooth:Software/syswow64:/c/Program:Files:(x86)/Windows:Live/Shared:/c/Program:Files:(x86)/Bazaar:/c/Program:Files:(x86)/QuickTime/QTSystem:/c/cygwin/home/william/bin:/c/ezwinports/bin:/c/Program:Files:(x86)/PuTTY:/usr/lib/lapack

This doesn't look right, and would explain the strange shell output I
reported.  (The value of PATH under bash looks normal.)  Did the installation
of tcsh somehow get corrupted?  I don't remember a particularly recent update
to tcsh.

-- 
Will


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2017-11-06 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06  0:15 strange shell output using tcsh under Cygwin Will Parsons
2017-11-06  2:50 ` Andrey Repin
2017-11-06 19:14   ` Will Parsons
2017-11-06 21:48 ` Will Parsons [this message]
2017-11-06 21:59   ` tcsh path conversion messed up? [was: strange shell output using tcsh under Cygwin] Will Parsons
2017-11-07  6:12     ` Brian Inglis
2017-11-07  9:08       ` Lemke, Michael  ST/HZA-ZIC2
2017-11-07 22:08         ` [SOLVED] Re: tcsh path conversion messed up? Will Parsons
2017-11-08 11:54           ` Lemke, Michael  ST/HZA-ZIC2

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='otqlbj$91n$1@blaine.gmane.org' \
    --to=wbp@nodomain.invalid \
    --cc=cygwin@cygwin.com \
    --cc=wbparsons@cshore.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).