Re: Is it fair to say, "sed supports # comments starting any column"?

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
Hi Daniel, 

 The POSIX spec does talk about the <semicolon> syntax, although it's not enforced.
 

 The System V "sed" has this restriction that only the 1st line can be a
 comment line, and then only if the first char. is #. (with #n as exception)
 

 As to why some SEDs are not POSIX compliant in terms of the comment char I am not sure. Many times, things are a relic of the past when memory was at a premium & the sed versions may never have gotten upgraded.
 

 Thanks,
 Rakesh
 

---In [email protected], <dgoldman@...> wrote :

 Hi Rakesh,
 
 I know you are trying to help. But you didn't answer any of my 
 questions. :( I am not a newbie trying to learn sed. I have specific 
 questions I am looking for experts such as yourself to weigh in on.
 
 You are probably aware that some sed versions do not support ; syntax. 
 Plus, the POSIX standard does not mention ; syntax. So offering ; as a 
 solution doesn't help anyway.
 
 Personally, I think it is fair to say, "sed supports # comments starting 
 any column", since that is what POSIX says. I am looking for someone to 
 explain why that is not true.
 
 Thanks,
 Daniel
 
 On 8/11/2015 12:23 AM, Rakesh Sharma [sed-users] wrote:
 > I normally use the ";#" syntax to start comments. The semicolon would start a newline and the # would then start at the first column, thus satisfying both.
 >
 >
 >> s/x/y/ # Silly comment 1
 >
 > s/x/y/ ;# Silly comment 1
 >
 > ________________________________ 




[Non-text portions of this message have been removed]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.