View Issue Details

IDProjectCategoryView StatusLast Update
00015961003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2022-10-27 15:30
ReporterMcDutchie Assigned To 
PrioritynormalSeverityObjectionTypeClarification Requested
Status ClosedResolutionDuplicate 
NameMartijn Dekker
Organizationhttps://github.com/ksh93/ksh
User Reference
SectionXCU 2.6
Page Number2319
Line Number74745-74746
Interp Status---
Final Accepted Text
Summary0001596: Not one, but three expansions may create multiple fields from a single word
DescriptionQuoting lines 74743-74746: "It is only field splitting or pathname expansion that can create multiple fields from a single word. The single exception to this rule is the expansion of the special parameter '@' within double-quotes, as described in Section 2.5.2."

The last sentence is not correct. An argument that consists of an unquoted $@ or $* both initially generates one field per positional parameter. Each word is then subject to pathname expansion, field splitting and empty removal. The former two can be disabled (using `set -f` and `IFS=` respectively) but that does not cause $@ or $* to generate just one field.

Proof:

$ (set -f; IFS=; set one two '' three; printf '@%s\n' $@; printf '*%s\n' $*)
@one
@two
@three
*one
*two
*three
Desired ActionReplace by: "It is only field splitting or pathname expansion that can create multiple fields from a single word. However, as a special exception to this rule, the expansion of the special parameter '@' within double-quotes, as well as the expansion of the unquoted special parameters '@' or '*', may generate multiple fields as described in Section 2.5.2."
TagsNo tags attached.

Relationships

duplicate of 0001193 Closed Brace expansion and {var}>file redirects in the shell 

Activities

geoffclare

2022-08-04 08:29

manager   bugnote:0005924

This problem came up during the work on bug 0001193 and is being fixed there. See 0001193:0003995.

This bug should be closed as a duplicate of 1193.

Issue History

Date Modified Username Field Change
2022-08-03 19:18 McDutchie New Issue
2022-08-03 19:18 McDutchie Name => Martijn Dekker
2022-08-03 19:18 McDutchie Organization => https://github.com/ksh93/ksh
2022-08-03 19:18 McDutchie Section => XCU 2.6
2022-08-03 19:18 McDutchie Page Number => 2319
2022-08-03 19:18 McDutchie Line Number => 74745-74746
2022-08-04 08:29 geoffclare Note Added: 0005924
2022-08-04 08:29 geoffclare Relationship added duplicate of 0001193
2022-10-27 15:30 geoffclare Interp Status => ---
2022-10-27 15:30 geoffclare Status New => Closed
2022-10-27 15:30 geoffclare Resolution Open => Duplicate