X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C7018386EC5B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.umass.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=moss AT cs DOT umass DOT edu Subject: Re: Limitation of setenv for tcsh: Too many arguments To: "KAVALAGIOS Panagiotis (EEAS-EXT)" , Achim Gratz , "cygwin AT cygwin DOT com" References: <0d66260ff1314bf693caa6cbb6647547 AT BELBRU-EXMP101 DOT eeas DOT europa DOT eu> <871revlnmg DOT fsf AT Otto DOT invalid> <63cabc18e6f845a7aaae49ce447cc152 AT BELBRU-EXMP101 DOT eeas DOT europa DOT eu> <87eeiv9zat DOT fsf AT Rainer DOT invalid> From: Eliot Moss Message-ID: <2cdbdff1-3656-3d84-5845-af1c8bfdcd91@cs.umass.edu> Date: Mon, 11 Jan 2021 10:34:53 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: moss AT cs DOT umass DOT edu Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" On 1/11/2021 3:11 AM, KAVALAGIOS Panagiotis (EEAS-EXT) wrote: >> -----Original Message----- >> From: Cygwin On Behalf Of Achim Gratz >> Sent: 08 January 2021 17:19 >> >> KAVALAGIOS Panagiotis (EEAS-EXT) writes: >>> Why do you say both? I don't add /usr/bin anywhere. >> >> Your other example with the $path csh variable doesn't quote $path, which >> you must do with the quote modifier rather than actual quotes, so $path:q >> because it is an wordlist var. Also see the -f / -l option for the set builtin of >> tcsh if you want to strip out duplicates and take note of some subtle >> differences in the default quoting between tcsh and csh if you are trying to >> be portable. > > I might forgot to double quote my variables in my ancient tcsh startup startup scripts using in other systems, but of course I have checked the issue on a clean environment before reporting that. Forget the tcsh, this is coming from the bash as well the very first time you are running Cygwin: > > ------------------- > Copying skeleton files. > These files are for the users to personalise their cygwin experience. > > They will never be overwritten nor automatically updated. > > './.bashrc' -> '/home/kavalpa//.bashrc' > './.bash_profile' -> '/home/kavalpa//.bash_profile' > './.inputrc' -> '/home/kavalpa//.inputrc' > './.profile' -> '/home/kavalpa//.profile' > > kavalpa AT BELBRU-L1903777 ~ > $ echo $PATH > /usr/local/bin:***/usr/bin***:/cygdrive/c/Program Files/Npm:[snip]:/cygdrive/c/Program Files/PHP/composer/bin:***/usr/bin***:/cygdrive/c/Users/kavalpa/AppData/Local/Microsoft/WindowsApps > ------------------- > > The issue is enclosed with a three-star notation. I have checked /etc startup files, but I couldn't figure out why this is happening. It is also weird the location at the end before user's personal paths. I don't have an answer as to why it's happening, but this bash code will remove duplicate PATH elements: newpath="@" while [ -n "${PATH}" ] ; do first="${PATH%%:*}" PATH="${PATH#${first}}" [ -n "${newpath##*@${first}@*}" ] && { newpath="${newpath}${first}" [ -n "${PATH}" ] && { newpath="${newpath}@" } } PATH="${PATH#:}" done newpath="$(/usr/bin/sed -e s/@/:/g <