diff --git a/hrc/test/_valid/shell/shell-bash-spec.bash.html b/hrc/test/_valid/shell/shell-bash-spec.bash.html index facdc94..dfa7c9c 100644 --- a/hrc/test/_valid/shell/shell-bash-spec.bash.html +++ b/hrc/test/_valid/shell/shell-bash-spec.bash.html @@ -26,11 +26,11 @@ 25: # 3.2.5.1 Looping Constructs 26: # for (( expr1 ; expr2 ; expr3 )) ; do commands ; done 27: - 28: for (( i = 0; $i < $VAR; i++ )); do + 28: for (( i = 0; $i < $VAR; i++ )); do 29: cmd 30: done 31: - 32: for (( i = 0; i < $VAR; i++ )); do + 32: for (( i = 0; i < $VAR; i++ )); do 33: cmd 34: done 35: @@ -39,8 +39,8 @@ 38: cmd 39: done 40: - 41: for (( i = "123"; $i < ${CDPATH}; i = $i / 100 )); do V1=456 command here; done - 42: for ((;;)); do V1=456 command here; done + 41: for (( i = "123"; $i < ${CDPATH}; i = $i / 100 )); do V1=456 command here; done + 42: for ((;;)); do V1=456 command here; done 43: 44: # 3.2.5.2 Conditional Constructs 45: @@ -54,15 +54,15 @@ 53: 54: select VAR in "BLA" "FOO" "BAR"; do; done 55: - 56: select VAR; do + 56: select VAR; do 57: command 58: if [ -n "$FOO" ]; then 59: something - 60: select VAR; do + 60: select VAR; do 61: done 62: fi - 63: select VAR; do - 64: select VAR; do + 63: select VAR; do + 64: select VAR; do 65: done 66: done 67: done @@ -70,8 +70,8 @@ 69: select IFS in; do done # POSIX special variable 70: select CDPATH in; do done # Bash special variable 71: - 72: ( select VAR; do done ) - 73: { select VAR; do done; } + 72: ( select VAR; do done ) + 73: { select VAR; do done; } 74: 75: 76: # (( ... )) @@ -189,7 +189,7 @@ 188: ${A@U} ${A@u} ${A@L} ${A@Q} ${A@E} ${A@P} ${A@A} ${A@K} ${A@a} ${A@k} 189: ${BASH@U} ${BASH@u} ${BASH@L} ${BASH@Q} ${BASH@E} ${BASH@P} ${BASH@A} ${BASH@K} ${BASH@a} ${BASH@k} 190: -191: for i in; do +191: for i in; do 192: "'${M:$i:1}" # <- test in for loop 193: done 194: @@ -247,7 +247,7 @@ 246: command 1<<< "string"$'ansi''single' 247: command <<< "HERE STRING" 248: -249: for i in; do +249: for i in; do 250: if bla; then 251: while read -r; do 252: done <<< "HERE STRING" @@ -364,11 +364,11 @@ 363: 364: # Bash variables in for loop 365: -366: for CDPATH; do +366: for CDPATH; do 367: foo 368: done 369: -370: for CDPATH in 1 2 3; do +370: for CDPATH in 1 2 3; do 371: foo 372: done 373: @@ -383,52 +383,52 @@ 382: 383: # 6.7 Arrays 384: -385: ADD=() -386: ARR=("val1" "val2" value\$one "val3" $(command here; echo \)) $'ansi-str') -387: ARR+=("val1" "val2" "val3" $(command here; echo \)) $'ansi-str') -388: ARR=(["foo"]="val1" [$VAR $VAR2 \] $VAR3]="val2" [$(V=1 command)]="foo" ["str"'str'$'\rstr']="str"'str'$'\rstr' ) +385: ADD=() +386: ARR=("val1" "val2" value\$one "val3" $(command here; echo \)) $'ansi-str') +387: ARR+=("val1" "val2" "val3" $(command here; echo \)) $'ansi-str') +388: ARR=(["foo"]="val1" [$VAR $VAR2 \] $VAR3]="val2" [$(V=1 command)]="foo" ["str"'str'$'\rstr']="str"'str'$'\rstr' ) 389: -390: ${!A[1]} ${!A["idx"]} +390: ${!A[1]} ${!A["idx"]} 391: -392: ARR[1]="val" +392: ARR[1]="val" 393: -394: ARR["FOO"]="val" [sdfsdf] # '[sdfsdf]' is a command -395: ARR[$IDX]="val" -396: ADD[${IDX[0]}]="foo" # <- index as array element -397: ADD[${#IDX[@]}]="foo" # <- index as array element +394: ARR["FOO"]="val" [sdfsdf] # '[sdfsdf]' is a command +395: ARR[$IDX]="val" +396: ADD[${IDX[0]}]="foo" # <- index as array element +397: ADD[${#IDX[@]}]="foo" # <- index as array element 398: 399: echo $A["foo"] # <- here is A["foo"] is not an array, it is "$A" and '["foo"]' -400: echo ${A["foo"]} # <- here is A["foo"] is an array +400: echo ${A["foo"]} # <- here is A["foo"] is an array 401: 402: A[$(echo bla)] # <- this should be the command 'A[bla]', not a variable/array -403: A[$(echo bla)]=1 command here foo # <- this should be an array assignment and a command +403: A[$(echo bla)]=1 command here foo # <- this should be an array assignment and a command 404: -405: A[fla echo 1]=1 # assignment -406: A[fla "echo]=" 1]=foo # assignment -407: echo ${A[fla "echo]=" 1]} # echo the assignment +405: A[fla echo 1]=1 # assignment +406: A[fla "echo]=" 1]=foo # assignment +407: echo ${A[fla "echo]=" 1]} # echo the assignment 408: 409: # Arrays + Shell Parameter Expansion 410: -411: ${A[foo]:-word} ${A['sdf']:=word} ${A[1]:?word} ${A[fff]:+word} +411: ${A[foo]:-word} ${A['sdf']:=word} ${A[1]:?word} ${A[fff]:+word} 412: -413: ${A[foo]:0} ${A[$'bla']:0:10} ${A[$(command)]: -1} ${A[10]: -1:-10} -414: ${A[1]:$(( ${#B} + 10 )):$(command here)} ${A[foo]:"10":$'\r\t10'} -415: ${A[0]:7} ${A[0]:1:10} ${A[@]:1} ${A[*]:1} +413: ${A[foo]:0} ${A[$'bla']:0:10} ${A[$(command)]: -1} ${A[10]: -1:-10} +414: ${A[1]:$(( ${#B} + 10 )):$(command here)} ${A[foo]:"10":$'\r\t10'} +415: ${A[0]:7} ${A[0]:1:10} ${A[@]:1} ${A[*]:1} 416: -417: ${#A[foo]} +417: ${#A[foo]} 418: -419: ${A[1]#word} ${A[foo]##word} ${A['sdf']%word} ${A[$(test)]%%word} +419: ${A[1]#word} ${A[foo]##word} ${A['sdf']%word} ${A[$(test)]%%word} 420: -421: " ${A[1]#word} ${A[foo]##word} ${A['sdf']%word} ${A[$(test)]%%word} " # <- in double quoted strings +421: " ${A[1]#word} ${A[foo]##word} ${A['sdf']%word} ${A[$(test)]%%word} " # <- in double quoted strings 422: -423: ${A[10]/pat/str} ${A[foo]//pat/str} ${A["a"]/#pat/str} ${A[0]/%pat/str} -424: ${A[foo]/$(command)/`test`"dbl"$'ansi'} +423: ${A[10]/pat/str} ${A[foo]//pat/str} ${A["a"]/#pat/str} ${A[0]/%pat/str} +424: ${A[foo]/$(command)/`test`"dbl"$'ansi'} 425: -426: ${A[10]^pat} ${A[foo]^^pat} ${A["bla bla"],pat} ${A[iii],,pat} -427: ${A[0]^$(command here)} ${A[1],,`test`"sdfasdf"$'\r\t\e'} +426: ${A[10]^pat} ${A[foo]^^pat} ${A["bla bla"],pat} ${A[iii],,pat} +427: ${A[0]^$(command here)} ${A[1],,`test`"sdfasdf"$'\r\t\e'} 428: -429: ${A[0]@U} ${A[1]@u} ${A[foo]@L} ${A["bla"]@Q} ${A[1]@E} -430: ${A[$'ansi']@P} ${A[$(command here)]@A} ${A[`command here`]@K} ${A[$VAR]@a} ${A[0]@k} +429: ${A[0]@U} ${A[1]@u} ${A[foo]@L} ${A["bla"]@Q} ${A[1]@E} +430: ${A[$'ansi']@P} ${A[$(command here)]@A} ${A[`command here`]@K} ${A[$VAR]@a} ${A[0]@k} 431: 432: # 6.8.1 Directory Stack Builtins 433: diff --git a/hrc/test/_valid/shell/shell-posix-spec.sh.html b/hrc/test/_valid/shell/shell-posix-spec.sh.html index acd2811..f642552 100644 --- a/hrc/test/_valid/shell/shell-posix-spec.sh.html +++ b/hrc/test/_valid/shell/shell-posix-spec.sh.html @@ -224,45 +224,45 @@ 223: do 224: done 225: -226: for IFS in $(V1=val command) 2 3; do command; done; # check special variable -227: for "IFS" in $(V1=val command) 2 3; do command; done; # check variable in quotes +226: for IFS in $(V1=val command) 2 3; do command; done; # check special variable +227: for "IFS" in $(V1=val command) 2 3; do command; done; # check variable in quotes 228: -229: for var in $VAR; do +229: for var in $VAR; do 230: 231: done 232: -233: for var in; error here do done +233: for var in; error here do done 234: do 235: done 236: -237: for var in; error here; do done +237: for var in; error here; do done 238: -239: for var in; do done +239: for var in; do done 240: -241: for VAR in "BLA" "FOO" "BAR"; do; done +241: for VAR in "BLA" "FOO" "BAR"; do; done 242: 243: for VAR # comment here 244: do 245: done 246: -247: for $(V1=val command here); do +247: for $(V1=val command here); do 248: command 249: done 250: -251: for VAR error here; do +251: for VAR error here; do 252: done 253: -254: for VAR; do +254: for VAR; do 255: command 256: if [ -n "$FOO" ]; then 257: something 258: fi 259: done 260: -261: for IFS; do command; done; # check special variable +261: for IFS; do command; done; # check special variable 262: -263: for "IFS"; do command; done; # variable in quotes <- 'in' word must not activate the 'in' syntax for form -264: for "IFS"; do command; done; # variable _in quotes +263: for "IFS"; do command; done; # variable in quotes <- 'in' word must not activate the 'in' syntax for form +264: for "IFS"; do command; done; # variable _in quotes 265: 266: # Case Conditional Construct 267: @@ -805,7 +805,7 @@ 804: done 805: 806: foo() { -807: for j in 1 2; do +807: for j in 1 2; do 808: echo 'break 2' >/tmp/do_break 809: echo " sourcing /tmp/do_break ($j)..." 810: # the behavior of the break from running the following command @@ -830,7 +830,7 @@ 829: sleep 1 830: done 831: } -832: for i in 1 2; do +832: for i in 1 2; do 833: echo "running foo ($i)..." 834: foo 835: done diff --git a/hrc/test/_valid/shell/test.sh.html b/hrc/test/_valid/shell/test.sh.html index 2fd1f58..c05051b 100644 --- a/hrc/test/_valid/shell/test.sh.html +++ b/hrc/test/_valid/shell/test.sh.html @@ -2,7 +2,7 @@ 1: #!/bin/sh 2: (cd x; y/a-b.sh) 3: -4: echo ${#aoeu[@]} +4: echo ${#aoeu[@]} 5: 6: DATE=`date` 7: echo $DATE