[SOLVED] Re: tcsh path conversion messed up?
- Date: Tue, 7 Nov 2017 22:07:53 +0000 (UTC)
- From: Will Parsons <firstname.lastname@example.org>
- Subject: [SOLVED] Re: tcsh path conversion messed up?
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:
>>>> 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
>>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
> 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.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple