tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Various shell-scripting idioms in bin/daemon.sh
Date Mon, 22 Jul 2013 23:28:46 GMT
Mladen,

On 7/17/13 7:59 AM, Mladen Turk wrote:
> On 07/16/2013 11:42 PM, Christopher Schultz wrote:
>> All,
>>
>> While doing the trivial fix for
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=55268, I noticed a
>> few idioms being used in bin/daemon.sh that struck me as odd. For
>> example:
>>
>> while [ ".$1" != . ]
>> do
>>    case "$1" in
>>      --java-home )
>>          JAVA_HOME="$2"
>>          shift; shift;
>>          continue
>>      ;;
>>
>>
>> This example actually illustrates the two main questions I had:
>>
>> 1. Why use [ ".$FOO" != . ] instead of simply [ -n "$FOO" ] (Corollary:
>> why use [ ".$FOO" = . ] instead of [ -z "$FOO" ])?
>>
> 
> Because some shell scripts does dot handle -z or -n well.

Fixed in bin/daemon.sh.

Thanks for the insight,
-chris


Mime
View raw message