Tíquete #40707

Result of tilde expansion in nested parameter expansion

: 2020-09-05 15:54 Última Atualização: 2020-09-22 21:19

Relator:
Dono:
Tipo:
Estado:
Aberto [Owner assigned]
Componente:
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Nenhum
Arquivo:
Nenhum
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

Currently, the result of ~ and ${unset-~} are not subject to field splitting or pathname expansion, but that of ${${unset-~}} is. Can we prevent expansion for the latter, too?

test_oE 'result of tilde expansion in nested parameter expansion'
HOME='/path/with  $space$(:)`:`$((1))' IFS=' /'
echoraw ${${u-~}}
HOME='*'
echoraw ${${u-~}}
__IN__
/path/with  $space$(:)`:`$((1))
*
__OUT__

Ticket History (2/2 Histories)

2020-09-05 15:54 Updated by: magicant
  • New Ticket "Result of tilde expansion in nested parameter expansion" created
2020-09-22 21:19 Updated by: magicant
Comentário

In the current implementation, the outer expansion receives the result of the inner expansion after it has performed quote removal. To honor the character origin of the inner expansion, however, the outer expansion needs to receive the result without quote removal. This will affect the character count in the outer expansion; for example, should ${${unset-"~"}[1 ]} expand to a double-quote or tilde?

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login