public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Will Parsons <wbp@nodomain.invalid>
To: cygwin@cygwin.com
Subject: [SOLVED] Re: tcsh path conversion messed up?
Date: Tue, 07 Nov 2017 22:08:00 -0000	[thread overview]
Message-ID: <ottaro$v2$1@blaine.gmane.org> (raw)
In-Reply-To: <8ef62c62e13846dd80c1ba65397b8a67@DE013666.schaeffler.com>

Lemke, Michael  ST/HZA-ZIC2 wrote:
> On Tuesday, November 07, 2017 7:12 AM Brian Inglis wrote:
>>On 2017-11-06 14:59, Will Parsons wrote:
>>> Will Parsons wrote:
>>>> I asked about what I thought was a shell scripting problem:
>>>>    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.
>
> How are you setting path? Do you have anything in your .cshrc/.login file? Most
> likely, you are doing it wrong. 
>
>>> Another bit of info - I just noticed that the value of the (t)csh shell
>>> variable 'path' is:
>>
>>In csh, "PATH" is a standard Unix environment variable whose value is a colon
>>separated directory list, and "path" is a shell wordlist kept synchonized with
>>"PATH".
>>To list the wordlist entries with embedded spaces in csh, quote the variable
>>name with the :q modifier in a foreach loop wordlist, and you get the desired
>>result as easily as in your sh script [trimmed and ...s redacted]:
>>
>>.......% foreach p ( $path:q )
>>foreach?	echo $p
>>foreach? end
>
> And that is also key for setting path:
>
> set path = ( ... $path:q )
>
> I had this bug ($path instead of $path:q) for 20 years in my init files.

Bingo!  I had this line in my ~/.cshrc:

  set path = ( /usr/local/bin /usr/bin /bin /usr/sbin $path )

Changing $path to $path.q solved the problem.

(I am still somewhat puzzled, though - the original PATH that I quoted in my
original query did have spaces, so what changed?)

At any rate, the problem seems to be solved, so thank you very much.

-- 
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

  reply	other threads:[~2017-11-07 22:08 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 ` tcsh path conversion messed up? [was: strange shell output using tcsh under Cygwin] Will Parsons
2017-11-06 21:59   ` Will Parsons
2017-11-07  6:12     ` Brian Inglis
2017-11-07  9:08       ` Lemke, Michael  ST/HZA-ZIC2
2017-11-07 22:08         ` Will Parsons [this message]
2017-11-08 11:54           ` [SOLVED] Re: tcsh path conversion messed up? 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='ottaro$v2$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).