Gotoif does not work if the variable come from SHELL function

hello dear friends,
i save output of a command in a variable with SHELL function , but this variable does not go to next priority that is GoToIf application:

my dialplan:
exten => 37,1,set(ping=${SHELL(ping -c 1 | grep ttl= | wc -l)})
exten => *37,2,verbose(${ping})
exten => *37,3,gotoif($["${ping}" = “1”]?internal,1234,1)
exten => 1234,1,dial(sip/router/93331…)

and my aserisk console log:
Executing [*37@internal:1] Set(“SIP/999-000000d8”, "ping=1
– ") in new stack
Executing [*37@internal:2] Verbose(“SIP/999-000000d8”, "ping=1
– ") in new stack
– Executing [*37@internal:3] GotoIf(“SIP/999-000000d8”, “0?internal,1234,1”) in new stack
– Auto fallthrough, channel ‘SIP/999-000000d8’ status is ‘UNKNOWN’
– Executing [h@internal:1] Hangup(“SIP/999-000000d8”, “”) in new stack
== Spawn extension (internal, h, 1) exited non-zero on ‘SIP/999-000000d8’

replace your dial by this.

exten => *37,1,set(ping=${SHELL(ping -c 1 | grep ttl= | wc -l)})
exten => *37,2,verbose(${ping:0:1})
exten => *37,3,gotoif($["${ping:0:1}" = “1”]?internal,1234,1)