[MAGNOLIA-3570] setenv.sh posix incompatibility Created: 27/Feb/11  Updated: 12/Sep/11  Resolved: 03/Jun/11

Status: Closed
Project: Magnolia
Component/s: build
Affects Version/s: 4.4.2
Fix Version/s: 4.4.5

Type: Bug Priority: Minor
Reporter: Mike Stoddart Assignee: Daniel Lipp
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.10


Issue Links:
duplicate
is duplicated by MAGNOLIA-3722 Tomcat bundle, setenv.sh: [ -a file ]... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

I tried to start Magnolia on Ubuntu 10.10 and I got the following error:

[: 15: -a: unexpected operator

I got the following response from someone on the mailing list:

Seems that it is a shell issue with setenv.sh, not actually magnolia_control.sh. When you run magnolia_control.sh it actually invokes startup.sh which in turn invokes setenv.sh.

If you look inside setenv.sh, there is the following:

if [ -a "${CURDIR}/magnolia_banner.txt" ] ; then
cat ${CURDIR}/magnolia_banner.txt
fi

As far as I'm aware the "-a" option is not a valid file test parameter in Dash, which is the shell invoked by /bin/sh in Ubuntu 10.10. You get the same problem if you explicitly invoke the startup script with another shell such as Bash, which doesn't have the -a option either.

I don't think it is causing any problems, as it is only trying to display the Magnolia Banner text.



 Comments   
Comment by Zdenek Skodik [ 28/Feb/11 ]

Thanks for the report. I'm able to reproduce it at Ubuntu 10.04.

I assume you're able to start it up and use Magnolia CMS without any further problems, do you?

Comment by Mike Stoddart [ 28/Feb/11 ]

I didn't have time to try it again over the weekend and I use Fedora 12 at work. So I'll have to try it again tonight. Thanks

Comment by Magnolia International [ 01/Mar/11 ]

Rob Blake was the person who pointed out the -a problem.

My reply: I found the -a test here: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html - and assumed it was standard. Is there an alternative ?

It does work on my GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)

Comment by Magnolia International [ 01/Mar/11 ]

Okay, looks like [ -f ... ] should do the trick.

Thanks for the report Mike; thanks Rob for the investigation !

Comment by Magnolia International [ 01/Mar/11 ]

or -e

Generated at Mon Feb 12 03:47:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.