delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/12/06/14:05:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; q=dns; s=default; b=nDvU
w8qIfnK1O5qOvNFHqwXu2eDiFRF9MoDfvUmLfLJn/P+q+woYlJDf1enjnq/X0eXV
mDH+ecQEO3yeNsddj2ofMGp4DWYT6GPlM6HixUnl6OCw8O2WIepCqw9LsAZn30PU
bDKM+aiqo46t3PaoqJepoqCiFkXmQrgd3bofLts=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:references
:mime-version:content-type:in-reply-to; s=default; bh=wOEzdscnZn
BzS/olt+0zLA/uGtA=; b=CnZ6ASUJ5DoDwH9AQfCmMcasiOeMFj2XtyAj54OVis
6oJ9jaie1m1VIM8fEpC/Mji+QddngD4fP5lGEJnsMj/Ft3mhGsGg0mUtQmOR+Bqj
1Yb6ZoCm5XDyQtoAeYr78g/NGfB0qA/za6C5IIDPmGDx/R9s0Bej7gli/BDhJ2Ce
o=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Tue, 6 Dec 2016 11:05:22 -0800
From: Gary Johnson <garyjohn AT spocom DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: profile_d
Message-ID: <20161206190522.GA31143@phoenix>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <80d344c2-c2d2-fc10-ea6d-4b7ac27785a5 AT earthlink DOT net> <4ae30a35-5300-32d5-5001-b6c7df088fa4 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <4ae30a35-5300-32d5-5001-b6c7df088fa4@cornell.edu>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-IsSubscribed: yes

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/<package>.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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019