[MAGNOLIA-3722] Tomcat bundle, setenv.sh: [ -a file ] should be replaced by (equivalent and more portable) [ -e file ] Created: 01/Jun/11  Updated: 12/Sep/11  Resolved: 03/Jun/11

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 4.4.4
Fix Version/s: 4.4.5

Type: Bug Priority: Neutral
Reporter: Felix Rabe Assignee: Daniel Lipp
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File setenv-patch.txt    
Issue Links:
duplicate
duplicates MAGNOLIA-3570 setenv.sh posix incompatibility Closed
Template:
Patch included:
Yes
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

 Description   

The [ -a file ] version breaks e.g. on Ubuntu, where '#!/bin/sh' scripts are executed by Dash which doesn't know [ -a file ].



 Comments   
Comment by Felix Rabe [ 01/Jun/11 ]

Tested and working on Mac OS X 10.6 (where /bin/sh is Bash) and Ubuntu 10.04 (test server, sh = Dash) and 10.10 (at home, sh = Dash).

See also: http://en.wikipedia.org/wiki/Test_(Unix)#Functions
If you run 'help test' in your (Bash) shell, you quickly see that '-a file' and '-e file' are equivalent for Bash.

Comment by Felix Rabe [ 03/Jun/11 ]

Affects trunk and branch 4.4, does not affect branch 4.3.

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