public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* profile_d
@ 2016-12-06 14:49 Charlie Perkins
  2016-12-06 17:57 ` profile_d Ken Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Perkins @ 2016-12-06 14:49 UTC (permalink / raw)
  To: cygwin

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!

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

Thanks in advance for any help.

Regards,
Charlie P.


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: profile_d
  2016-12-06 14:49 profile_d Charlie Perkins
@ 2016-12-06 17:57 ` Ken Brown
  2016-12-06 19:04   ` profile_d Gary Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Brown @ 2016-12-06 17:57 UTC (permalink / raw)
  To: cygwin

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?

Ken

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: profile_d
  2016-12-06 17:57 ` profile_d Ken Brown
@ 2016-12-06 19:04   ` Gary Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Johnson @ 2016-12-06 19:04 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-06 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-06 14:49 profile_d Charlie Perkins
2016-12-06 17:57 ` profile_d Ken Brown
2016-12-06 19:04   ` profile_d Gary Johnson

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