[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

VSC-lite testcase# sh_05 293



Hello All,

>>  >    2. POSIX: section 3.5 Parameters and Variables: sh_05 293:
>>  >      When a variable has been assigned a value (including the null
>>  >     value), then the variable is set and can only be unset by use of
>>  >       the unset special built-in.
>>  >     Test: BUG: Expecting ' set | grep "an_unset_var" ' to return 1 as
>>  >       exit status indicating an_unset_var is in fact unset. However,
>>  >       grep will catch lots of false positives this way. The correct
way
>>  >       is to grep for '^an_unset_var='.
>>  >      Bash:
>>  >       Type: 1
>> >
>>  >The chances of the grep matching the name or contents of another
>>  >shell variable are very small given that the variable name used
>>  >is "sh5_293_var".  The test is almost certainly failing because bash
>>  >is including function definitions in the output of "set".  If this
>>  >non-compliance of bash is fixed then the test should pass.

I received the response below from Mr. Chet Ramey, the current bash
maintainer.  Please feel free to respond so we can come to a resolution.

>The standard says that `set' without options shall list all variables
>and their values to the standard output.  Bash does this.  It says
>nothing about shell functions, therefore leaving it unspecified.  Bash
>outputs functions, too.  There's no conflict here; bash simply
>implements an extension beyond the standard.  Does everything that a
>shell does beyond the bare minimum specified by the standard make it
>non-compliant?
>
>It's a minor change to make the test script robust.  If you're looking
>for a particular variable on a POSIX system, why not test for the output
>format POSIX specifies?


AndrewP

Andrew H. Pham
andpha@us.ibm.com
IBM Linux Technology Center
Voice:   (512)838-9473    T/L 678-9473



Reply to: