You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2020/06/06 17:00:59 UTC

[Bug 64501] New: The catalina.sh script is returning a "bad substitution" error and exiting

https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

            Bug ID: 64501
           Summary: The catalina.sh script is returning a "bad
                    substitution" error and exiting
           Product: Tomcat 9
           Version: 9.0.35
          Hardware: Sun
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: pete.pocius@perspecta.com
  Target Milestone: -----

We are in the process of upgrading from Tomcat version 9.0.31 to 9.0.35.  When
starting Tomcat version 9.0.35 on a Solaris UNIX system, the catalina.sh script
is returning a "bad substitution" error and exiting.  It appears the following
"if statement" in the script is causing the error:

if [ "${LOGGING_CONFIG#*-D}" != "$LOGGING_CONFIG" ]; then

Can someone look into this bug?

Thank you

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #3 from Pete Pocius <pe...@perspecta.com> ---
(In reply to Michael Osipov from comment #2)
> On some Solaris versions the Bourne shell is not fully POSIX compliant. I
> assume that our script is proper POSIX compliant. This parts seems to be:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

Hi Michael,

Thanks for the reply.  It looks like on our version of Solaris (Sun version
10), the default Bourne shell is not fully POSIX compliant as you mentioned. 
When I change the #!/bin/sh to #!/usr/xpg4/bin/sh the script works.  Based on
this, will we just have to adjust the script to use that version of the Bourne
shell going forward, or will a change be made to that "if statement" to handle
both POSIX and non-POSIX compliant systems?

Thanks,
Pete Pocius

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #8 from Mark Thomas <ma...@apache.org> ---
Confirmed. Case works on Solaris 10. I'll switch the code to that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #2 from Michael Osipov <mi...@apache.org> ---
On some Solaris versions the Bourne shell is not fully POSIX compliant. I
assume that our script is proper POSIX compliant. This parts seems to be:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
We might be able to do something with "case". It is used elsewhere in
catalina.sh for pattern matching.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #1 from Christopher Schultz <ch...@christopherschultz.net> ---
What is your /bin/sh actually running?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #6 from Pete Pocius <pe...@perspecta.com> ---
(In reply to Mark Thomas from comment #5)
> We might be able to do something with "case". It is used elsewhere in
> catalina.sh for pattern matching.

Hi Mark,

For now, we've commented-out the block of code checking for deprecated logging,
and the script runs successfully.  I'll leave it up to you whether or not you
want to do something with "case".

Thanks,
Pete Pocius

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from Mark Thomas <ma...@apache.org> ---
Thanks for the report.

Fixed in:
- 9.0.x for 9.0.37 onwards
- 8.5.x for 8.5.57 onwards
- 7.0.x for 7.0.105 onwards

10.0.x was not affected.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #7 from Mark Thomas <ma...@apache.org> ---
I'd like to fix it if we can.

"#*-D" is really a "contains" test, not a "starts with" test. We'd need to drop
the "*" to get a "starts with" test. Currently investigating case an
alternative.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #10 from Pete Pocius <pe...@perspecta.com> ---
(In reply to Mark Thomas from comment #9)
> Thanks for the report.
> 
> Fixed in:
> - 9.0.x for 9.0.37 onwards
> - 8.5.x for 8.5.57 onwards
> - 7.0.x for 7.0.105 onwards
> 
> 10.0.x was not affected.

Hi Mark,

Thanks for taking care of that!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64501] The catalina.sh script is returning a "bad substitution" error and exiting

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64501

--- Comment #4 from Michael Osipov <mi...@apache.org> ---
(In reply to Pete Pocius from comment #3)
> (In reply to Michael Osipov from comment #2)
> > On some Solaris versions the Bourne shell is not fully POSIX compliant. I
> > assume that our script is proper POSIX compliant. This parts seems to be:
> > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
> 
> Hi Michael,
> 
> Thanks for the reply.  It looks like on our version of Solaris (Sun version
> 10), the default Bourne shell is not fully POSIX compliant as you mentioned.
> When I change the #!/bin/sh to #!/usr/xpg4/bin/sh the script works.  Based
> on this, will we just have to adjust the script to use that version of the
> Bourne shell going forward, or will a change be made to that "if statement"
> to handle both POSIX and non-POSIX compliant systems?

The question is what is suitable alternative for ${parameter#word}? Bourne
shell on Solaris 10 doesn't support $(command) either.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org