Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!hpda!hpcupt1!hpirs!wk From: wk@hpirs.HP.COM (Wayne Krone) Newsgroups: comp.bugs.sys5 Subject: nl(1) defect or feature? Message-ID: <3920009@hpirs.HP.COM> Date: 18 Jan 89 01:41:14 GMT Organization: Hewlett Packard, Cupertino Lines: 18 The command nl(1) numbers the lines of the input text. You can limit the lines numbered to those matching the regular expression "pattern" by using the option "-bppattern" (among others). While doing some other work on nl(1), I noticed when it processes a text line it passes the text plus the trailing newline to the regular expression routine. This means the line: abc must be matched by the RE "abc\n$" instead of "abc$". Other commands strip off the newline before performing the regular expression match. It's quite easy to make nl(1) work similar to the other commands, but I was unsure whether I should fix this as a defect or document it as a feature. Any opinions? Thanks, Wayne Krone