2010-05-22 09:35:02 +05:30
|
|
|
"$THIS_SH" -c 'echo $#'
|
|
|
|
"$THIS_SH" -c 'echo $#' arg0
|
|
|
|
"$THIS_SH" -c 'echo $#' arg0 arg1
|
|
|
|
|
|
|
|
echo Make sure len parsing doesnt break arg count
|
2009-03-29 00:25:34 +05:30
|
|
|
set --
|
|
|
|
echo $# ${#}
|
|
|
|
set -- aaaa bbb cc d
|
|
|
|
echo $# ${#}
|
|
|
|
|
2010-05-22 09:35:02 +05:30
|
|
|
echo Testing len op
|
2009-03-29 00:25:34 +05:30
|
|
|
echo ${#1} ${#2} ${#3} ${#4} ${#5} ${#6}
|
|
|
|
|
|
|
|
unset e
|
|
|
|
f=abc
|
|
|
|
g=
|
|
|
|
echo ${#e} ${#f} ${#g}
|
2016-10-26 19:26:53 +05:30
|
|
|
|
|
|
|
set -- a
|
|
|
|
# This must be interpreted as: $# ("1"), then remove trailing "1".
|
|
|
|
# IOW: empty result.
|
|
|
|
echo Nothing:${##1}
|
|
|
|
echo Nothing:${#%1}
|
|
|
|
echo One:${##x}
|