A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1852 ====================================================================== Reported By: steffen Assigned To: ====================================================================== Project: 1003.1(2024)/Issue8 Issue ID: 1852 Category: Shell and Utilities Type: Clarification Requested Severity: Editorial Priority: normal Status: New Name: steffen Organization: User Reference: Section: 2.52 Page Number: 2479 Line Number: 80376 ff. Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2024-08-14 23:38 UTC Last Modified: 2024-09-02 19:35 UTC ====================================================================== Summary: Clarify "$@[:$@:]" (with $# -eq 0) ======================================================================
---------------------------------------------------------------------- (0006871) McDutchie (reporter) - 2024-09-02 19:35 https://austingroupbugs.net/view.php?id=1852#c6871 ---------------------------------------------------------------------- Here is a more comprehensive regression test I wrote. Expected output: none. Feel free to use any or all of it. I hereby dedicate it to the public domain as per Creative Commons CC-0: https://creativecommons.org/publicdomain/zero/1.0/ for e in 3 '"$@"' \ 5 '"$@$@"' \ 7 '"$@$@$@"' \ 9 '"$@$@$@$@"' \ 11 '"$@$@$@$@$@"' \ 13 '"$@$@$@$@$@$@"' \ 5 '"$@""$@"' \ 7 '"$@""$@""$@"' \ 9 '"$@""$@""$@""$@"' \ 11 '"$@""$@""$@""$@""$@"' \ 13 '"$@""$@""$@""$@""$@""$@"' do case $e in [0-9]*) i=$e continue ;; esac set -- # set zero PPs eval "set -- $e" test "$#" -eq 0 || echo "$e does not yield zero fields for" \ "zero positional parameters (got $#)" set -- one two three eval "set -- $e" test "$#" -eq "$i" || echo "$e does not yield $i fields for" \ "3 positional parameters (got $#)" for q in "''" '""' do for q in "$q" "$q$q" "$q$q$q" "$q$q$q$q" \ "$q$q$q$q$q" "$q$q$q$q$q$q" do for E in "$q$e" "$e$q" "$q$e$q" do set -- # set zero PPs eval "set -- $E" test "$#" -eq 1 || echo "$E does not" \ "yield one field for zero" \ "positional parameters (got $#)" set -- one two three eval "set -- $E" test "$#" -eq "$i" || echo "$E does not" \ "yield $i fields for 3" \ "positional parameters (got $#)" done done done done Issue History Date Modified Username Field Change ====================================================================== 2024-08-14 23:38 steffen New Issue 2024-08-14 23:38 steffen Name => steffen 2024-08-14 23:38 steffen Section => 2.52 2024-08-14 23:38 steffen Page Number => 2479 2024-08-14 23:38 steffen Line Number => 80376 ff. 2024-08-15 09:30 geoffclare Note Added: 0006862 2024-08-15 18:38 steffen Note Added: 0006865 2024-08-15 19:40 salewski Issue Monitored: salewski 2024-08-19 20:16 McDutchie Note Added: 0006866 2024-09-02 15:21 geoffclare Note Added: 0006869 2024-09-02 15:55 hvd Note Added: 0006870 2024-09-02 16:18 hvd Note Edited: 0006870 2024-09-02 19:35 McDutchie Note Added: 0006871 ======================================================================