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

Re: LSB Proposal: GNU/Linux Standard Shell



All
Enclosed is our feedback on the proposal circulated by Andy Pham
yesterday. This responds to the items that were designated "Type: 1"
and added comments after each one.

best regards
Andrew

    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.

    8. POSIX: section 3.6.4 Arithmetic Expansion: sh_05 357:
       The resulting expression derived from $((expression)) is evaluated
       according to the rules for Arithmetic Precision and Operations,
       subject to the exceptions given in POSIX.2 {9}, and substitutes
       the resulting value for the expression.
       Test: BUG: accessing value of a variable without using $ in front
       of a variable (e.g., [ x -eq 2 ] instead of [$x -eq 2]).
       Bash:
       Type: 1

Accepted.

   11. POSIX: GA10 sh_05 378:
       GA10 - When a file is newly created by the $CATCREATEOUT utility,
       then the file attributes are set as follows:
       (1) The file's user ID is set to the effective user ID of the
       creating process.
       (2) The file's group ID is set to either the effective group ID of
       the creating process or to the group ID of the directory in which
       the file is created.
       (3) The file's permission bits are set to
       S_IROTH|S_IWOTH|S_IRGRP|S_IWGRP|S_IRUSR|S_IWUSR except that the
       bits set in the creating processes file mode creation mask are
       cleared.
       (4) The st_atime, st_ctime and st_mtime fields of the file are
       updated
       (5) When the file is a directory, then the directory is created
       empty.
       (6) When the file is not a directory, then it has zero length.
       (7) When the file type is not specified, then a regular file is
       created.
       Test: BUG: unable to locate GetFileData which is supposed to come
       with the test suite.
       Bash:
       Type: 1

[Note this test is in sh_06 not sh_05]

GetFileData is a function defined in Shlib/GetFileData.SH, which is
sourced from ga10.SH using the command:

    [ -z "$_GetFileData_H" ] && . $TS_SHLIB/GetFileData.SH

Assuming Shlib/GetFileData.SH has been included in VSC5-lite, further
investigation will be needed to find out why the function is not
getting defined.

   12. POSIX: GA11 sh_06 379:
       When a file that exists is re-created by a POSIX.2 application,
       then the file attributes are set as follows:
       (1) When the file type is a directory or FIFO special file, then
       the attempt fails and the file attributes are not changed.
       (2) When the file type is a regular file, then the file is
       truncated to zero length and the st_ctime and st_mtime fields are
       updated. The user-ID, group-ID and permission bits associated with
       the file are unchanged.
       Test: BUG: unable to locate GetFileData which is supposed to come
       with the test suite.
       Bash:
       Type: 1

See 11.
[In this case GetFileData.SH is sourced from Shlib/GetFileMode.SH, which
is sourced from ga11.SH]

   23. POSIX: section 3.9.3.1 Asynchronous Lists: sh_08 461:
       The special parameter $! expands to the process ID of the last
       command in an asynchronous list.
       Test: BUG: 1) use print command in a script.
       2) invoke a shell script directly without putting the dot/sh
       command in front (e.g., sh8_461_2sh& instead of sh sh8_461_2sh& ).
       Bash:
       Type: 1

I assume the "Type: 1" only applies to the first part (use of "print"),
since Chet's list says this test "works with bash-2.05 when `print'
changed to `echo'".

The use of "print" is accepted as a bug in VSC.

   24. POSIX: section 3.9.3.1 Asynchronous Lists: sh_08 462:
       The process ID of the last command in an asynchronous list shall
       remains available to the shell (via the special parameter $!)
       until the shell executes a wait command, or another asynchronous
       list is invoked before $! is expanded in the current execution
       environment.
       Test: BUG: 1) use print command in a script.
       2) invoke a shell script directly without putting the dot/sh
       command in front (e.g., sh8_461_2sh& instead of sh sh8_461_2sh& ).
       Bash:
       Type: 1

See 23.

   25. POSIX: section 3.9.4.1 Grouping Commands: sh_08 474:
       Variable assignments and built-in commands that affect the
       environment do not shall remain in effect after the (list)
       finishes.
       Test: BUG: Using 'set | grep "an_unset_var" to make sure an unset
       variable does not exist; however, this will catch lots of false
       positive.
       Bash: works.
       Type: 1

See 2.

   26. POSIX: section 3.9.4.2 for Loop: sh_08 478:
       The commands executed in the for loop are delimited by the words
       do and done.
       Test: BUG: 1) use print command in a script.
       2) invoke a shell script directly without putting the dot/sh
       command in front (e.g., sh8_461_2sh& instead of sh sh8_461_2sh& ).
       Bash: works.
       Type: 1

See 23.

   27. POSIX: section 3.9.4.2 for Loop: sh_08 479:
       The list of words following 'in' in the for loop shall expand to
       generate a list of words
       Test: BUG: 1) use print command in a script.
       2) invoke a shell script directly without putting the dot/sh
       command in front (e.g., sh8_461_2sh& instead of sh sh8_461_2sh& ).
       Bash: works.
       Type: 1

See 23.

   28. POSIX: section 3.9.5 Function Definition Command: sh_09 517:
       When a word expansion error occurs during a call to a function,
       then a non-interactive shell aborts. Redirection error shall not
       cause non-interactive shell to abort.
       Test: BUG: expects non-interactive shell to abort when redirection
       error is encountered.
       Bash: works.
       Type: 1

This classification as a test bug doesn't match Chet's list, which says
the test works with bash-2.05.

I believe the test is correct, as the redirection is applied to a
special built-in command (eval), and according to POSIX and XCU it
should cause a non-interactive shell to abort in this case.

   31. POSIX: section 3.13.1 Patterns Matching a Single Character: sh_09
       532:
       When used outside a bracket expression and immediately preceded by
       a backslash each of the characters '|', '&', ';', '<', '>', '(',
       ')', '$', '`', '\', '"', "'", '', '', '', '?', '*', or '[' matches
       itself. [Derived from GA108.]
       Test: BUG: syntax error when trying to create a shell script(e.g.,
       using \\& instead of \&).
       Bash: works.
       Type: 1

Accepted.


---
Andrew Josey
The Open Group



Reply to: