[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wc reallines patch

From: Bob Proulx
Subject: Re: wc reallines patch
Date: Mon, 3 Feb 2003 10:21:24 -0700
User-agent: Mutt/1.3.28i

Ulf Harnhammar wrote:
> The current wc doesn't really count the number of lines in a file. It
> counts LF characters.

Aren't lines defined by newline characters?  Isn't a file that is
missing a newline really missing a line, that is, that last line is
only half constructed?  A partial line?

I realize that sometimes there is nothing else to end a sentence with.
But those last characters in the file before the file stops seem to be
dangling.  I am not really sure if I am just reading the file in the
process of being written.  Will more characters appear later and
finish things off?  Did the process writing that line get killed
before it could finish the job?

> My patch therefore adds the new -i (--reallines) option, which counts the
> actual number of lines in a file. wc -i on the second example file above
> would give the output 3.

I object to the wording "reallines" primarily because that last line
getting added to the count is not really a line but is just getting
faked out as one.  It would be better to call it "fakelines" instead.

Perhaps a better word would be counting it as a partial line.
Therefore adding '--partial-lines' would count any part of a line.

> If I have convinced you, I will produce a patch against the alpha version
> of coreutils. I'm unfortunately not familiar with TeX, but I can try to
> add some information in the manual as well.

Fortunately 'texinfo' is a simplified form of TeX.  No TeX knowledged
is needed.  Don't let that scare you off.  'texinfo' is a mostly plain
text documentation format.


But personally I find the online textinfo documentation best.

  info texinfo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]