| 1 |
|
| 2 |
BEGIN{ |
| 3 |
|
| 4 |
A[ "any index" ] = 1 # any number |
| 5 |
|
| 6 |
for ( i in A ) { |
| 7 |
|
| 8 |
v = A[ i ] |
| 9 |
|
| 10 |
gensub( /^/, "1", 1, v ) |
| 11 |
|
| 12 |
#gsub( /^dfsdfs/, "1", v ) |
| 13 |
|
| 14 |
#sub( /^/, "1", v ) |
| 15 |
|
| 16 |
if ( typeof( A[ i ] ) == "unknown" ) |
| 17 |
|
| 18 |
print "ERROR: A[ " i " ] == " A[ i ] "'" } |
| 19 |
|
| 20 |
v = A[ "any index" ] |
| 21 |
|
| 22 |
print typeof( v ) |
| 23 |
|
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
# GNU Awk 5.1.0, API: 3.0 (GNU MPFR 3.1.5, GNU MP 6.1.2) |
| 29 |
# Copyright (C) 1989, 1991-2020 Free Software Foundation. |
| 30 |
# |
| 31 |
# Windows 10x64 |
| 32 |
# |
| 33 |
# here is the typeof() error reproducing script |
| 34 |
# it is actual for: gensub(), gsub() and sub() built-ins |
| 35 |
# |
| 36 |
# please pay attention that: v = A[ i ] is doesn't matter |
| 37 |
# you may apply built-ins at A[ i ] directly with the same |
| 38 |
# result |
| 39 |
# |
| 40 |
# with Respect |
| 41 |
# |
| 42 |
# Denis Shirokov (2021.9.5) |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|