UVR wrote:
> Vladimir Kotal wrote on Wed Jul 09 2008 at 04:54:16 GMT-0700 (PDT):
>> [snip]
>>
>> Thus: What is the recommended "style" for ksh based test suites - 
>> double or single square brackets ? Does ksh93 process the two cases 
>> differently than ksh88 ?
>>
> 
> The Bourne/Korn shell style guide[1] clearly recommends using

Aha, so we have shell-discuss after all ! Somehow I did not see it 
previously. I am Cc'ing it now.

> "[[ ... ]]" for ksh and "(( ... ))" for arithmetic expressions,
> and those would be my recommendation too.  The guide presents
> 'perf' as the reason for suggestiong the double brackets.

Based on my investigation the performance improvement with double square 
brackets for simple comparison tests in ksh88 is neglectable. It's 
probably more visible with complicated (logic) expressions.

>> The main question for me is: should I be using double square brackets 
>> for test predicates in nc test suite before I take next step in the 
>> integration process ? (nc test suite is fully ksh based)
> 
> Do use them, but more importantly, make sure your test suite runs
> correctly under both ksh88 and ksh93.

ok, I will rewrite the tests in nc test suite to use double brackets.

Is there something like kstyle script ? (similar to cstyle used by wx)

Also, any idea how to test a test suite against specific ksh version 
without changing /usr/bin/ksh binary on the test system ?


v.

Reply via email to