View Issue Details

IDProjectCategoryView StatusLast Update
00015881003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2022-06-20 16:26
Reporterakbar Assigned To 
PrioritynormalSeverityCommentTypeEnhancement Request
Status ClosedResolutionRejected 
NameAkbar
Organization
User Reference
Section2.7.4 Here-Document
Page Number(page or range of pages)
Line Number(Line or range of lines)
Interp Status---
Final Accepted Text
Summary0001588: Any arbitrary leading whitespace should be stripped before a here-doc delimiter
DescriptionIn a world where there are two distinct styles of indentation (tabs vs. spaces) and where text editors can automatically expand or unexpand indents depending on one's preferences, the current standard is too restrictive regarding here-documents:

> If the redirection operator is "<<-", all leading <tab> characters shall be stripped from input lines and the line containing the trailing delimiter.

This forces a shell programmer to be extra mindful of their indents in a here-document. A tab person may even opt to ditch the indents altogether just to make sure the next maintainer doesn't accidentally expand them with spaces and risk breaking the whole script, while a space person won't be able to indent their here-documents at all, leaving them dissatisfied and potentially mad.
Desired ActionTherefore, to catch up with modern times, I suggest this restriction revised and eventually loosened to allow any arbitrary white space to appear before a here-document delimiter.
TagsNo tags attached.

Activities

kre

2022-06-18 22:36

reporter   bugnote:0005852

There is nothing "modern" about the distinction between spaces and tabs,
it has always existed.

The difference is deliberate, and scripts all over the place will break if
anything is changed in this area.

Reject this please.

calestyo

2022-06-18 22:46

reporter   bugnote:0005853

Last edited: 2022-06-18 22:48

Such change, if adopted, would possibly break countless of existing scripts.

Needs to be rejected.

(PS: Hadn't reloaded the tab and missed that kre had already commented the same)

Issue History

Date Modified Username Field Change
2022-06-18 17:42 akbar New Issue
2022-06-18 17:42 akbar Name => Akbar
2022-06-18 17:42 akbar Section => 2.7.4 Here-Document
2022-06-18 17:42 akbar Page Number => (page or range of pages)
2022-06-18 17:42 akbar Line Number => (Line or range of lines)
2022-06-18 22:36 kre Note Added: 0005852
2022-06-18 22:46 calestyo Note Added: 0005853
2022-06-18 22:46 calestyo Note Edited: 0005853
2022-06-18 22:48 calestyo Note Edited: 0005853
2022-06-20 16:26 geoffclare Interp Status => ---
2022-06-20 16:26 geoffclare Status New => Closed
2022-06-20 16:26 geoffclare Resolution Open => Rejected