79281441

Date: 2024-12-14 21:25:14
Score: 0.5
Natty:
Report link

With the P flag at the same level of nesting as the ::= assingment, after transforming the reference parameter to include the desired subscript:

ref=var var='Some value'
: ${(P)${ref/%/[1,4]}::='Cool'}
echo $var

that should output Cool value

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: rowboat