mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-10 13:40:55 +02:00
77 lines
659 B
Plaintext
77 lines
659 B
Plaintext
n() { echo $#; }
|
|
|
|
set --
|
|
|
|
n "$@"
|
|
|
|
# should be 1
|
|
n "$@"''
|
|
n ''"$@"
|
|
n ''"$@"''
|
|
|
|
set -- ''
|
|
|
|
n "$@"
|
|
# should be 1
|
|
n "$@"''
|
|
n ''"$@"
|
|
n ''"$@"''
|
|
|
|
set -- '' ''
|
|
|
|
n "$@"
|
|
# should be 2
|
|
n ''"$@"
|
|
# should be 2
|
|
n "$@"''
|
|
# should be 2
|
|
n ''"$@"''
|
|
|
|
x=x
|
|
|
|
set --
|
|
|
|
n ${x+"$@"}
|
|
|
|
# should be 1
|
|
n ${x+"$@"''}
|
|
n ${x+''"$@"}
|
|
n ${x+''"$@"''}
|
|
|
|
set -- ''
|
|
|
|
n ${x+"$@"}
|
|
# should be 1
|
|
n ${x+"$@"''}
|
|
n ${x+''"$@"}
|
|
n ${x+''"$@"''}
|
|
|
|
set -- '' ''
|
|
|
|
n ${x+"$@"}
|
|
# should be 2
|
|
n ${x+''"$@"}
|
|
# should be 2
|
|
n ${x+"$@"''}
|
|
# should be 2
|
|
n ${x+''"$@"''}
|
|
|
|
|
|
set --
|
|
|
|
n "$@" "$@"
|
|
n "$@""$@"
|
|
|
|
n ${x+"$@" "$@"}
|
|
|
|
set -- ''
|
|
|
|
n ${x+"$@" "$@"}
|
|
n "$@" "$@"
|
|
|
|
set -- '' ''
|
|
|
|
n ${x+"$@" "$@"}
|
|
n "$@" "$@"
|
|
n "$@""$@"
|