待辦事項 #40707

Result of tilde expansion in nested parameter expansion

啟用日期: 2020-09-05 15:54 最後更新: 2020-09-22 21:19

回報者:
負責人:
類型:
狀態:
開啟 [Owner assigned]
元件:
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
檔案:
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

細節

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
評語

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

編輯

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