From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6124 invoked by alias); 6 Dec 2016 19:04:47 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 6112 invoked by uid 89); 6 Dec 2016 19:04:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:4ae30a3, H*i:sk:4ae30a3, H*MI:sk:4ae30a3 X-HELO: mail.spocom.com Received: from mail.spocom.com (HELO mail.spocom.com) (206.63.224.240) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Dec 2016 19:04:36 +0000 Received: from localhost (174-31-32-127.spkn.qwest.net [174.31.32.127]) by mail.spocom.com with SMTP; Tue, 6 Dec 2016 11:04:14 -0800 Date: Tue, 06 Dec 2016 19:04:00 -0000 From: Gary Johnson To: cygwin@cygwin.com Subject: Re: profile_d Message-ID: <20161206190522.GA31143@phoenix> Mail-Followup-To: cygwin@cygwin.com References: <80d344c2-c2d2-fc10-ea6d-4b7ac27785a5@earthlink.net> <4ae30a35-5300-32d5-5001-b6c7df088fa4@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ae30a35-5300-32d5-5001-b6c7df088fa4@cornell.edu> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00046.txt.bz2 On 2016-12-06, Ken Brown wrote: > On 12/6/2016 9:49 AM, Charlie Perkins wrote: > >Hello anyone, > > > >Could someone tell me what profile_d does? > > > >There doesn't seem to be a man page, info, or any way I can find out! > > It's defined in /etc/profile, shortly before the call to 'profile_d > sh'. The latter runs all the *.sh scripts in /etc/profile.d, with > some fiddling to get locales right. > > >I'm getting the following errors from profile_d when /etc/profile > >invokes 'profile_d sh': > > > >>-bash: [: too many arguments > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > >>-bash: [: too many arguments > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > >>-bash: [: =: unary operator expected > > I'm guessing that these errors are generated by the line > > if [ "${_LC_SAVE_}" = "null" ]; then > > in the definition of profile_d. Is LC_ALL defined in your > environment? Does it have spaces in it? I've seen that error from my own bash scripts when I neglect to enclose a variable in double-quotes before testing it, as if [ $THIS = "That" ]; then and when in some situation that variable is not set. I would not expect to see that error from the line if [ "${_LC_SAVE_}" = "null" ]; then because ${_LC_SAVE_} _is_ surrounded by double-quotes and so the binary operator = will have operands on both sides. However, profile_d is sourcing every .sh file in /etc/profile.d and one or more of those files may not be enclosing some variable(s) in double-quotes. All of the .sh files in my /etc/profile.d handle their variables correctly, so the error is probably in the /etc/profile.d/.sh file of some package that I don't have installed. Regards, Gary -- 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