待辦事項 #40842

Environment of redirections

啟用日期: 2020-10-07 21:29 最後更新: 2020-11-05 21:00

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

細節

XCU 2.9.1 says:

If there is no command name, any redirections shall be performed in a subshell environment

This means:

  • Such a redirection should not cause the shell to exit on error.
  • Assignments in such a redirection does not survive.

Currently, the latter is not implemented in yash (and the former may or may not be well tested).

Test case:

unset x
< ${x=/no/such/file}
echo $x

Ticket History (3/4 Histories)

2020-10-07 21:29 Updated by: magicant
  • New Ticket "Environment of redirections" created
2020-11-03 22:21 Updated by: magicant
評語

Test added in r4139

2020-11-03 23:53 Updated by: magicant
評語

POSIX does not specify which of assignments and redirections should be done first when there is no command name in a simple command. However, should the redirections be performed in a subshell, assignments need to be performed before the subshell is forked.

2020-11-05 21:00 Updated by: magicant
  • 處理結果 Update from to 修正
  • 狀態 Update from 開啟 to 關閉
評語

Fixed in r4141, r4142, and r4143

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. » 登入