Spaggiari, Jean-Marc wrote:
> wc is counting words "testing/moving" like only one word... Is it an
> issue?  Or a bug?  wc is counting words "it's" like only one word,
> but it's two... Is it an issue? Or a bug?

The original UNIX V7 manual documents 'wc' this way:

    A word is a maximal string of characters delimited by spaces, tabs
    or newlines.

Not breaking scripts which rely upon this behavior is very important.
The 'shar' program as one classic example has used 'wc' as an
inexpensive checksum-like of integrity check.  Changing the definition
can break a lot of existing scripts.

The single unix specification defines it this way:

    http://www.unix-systems.org/single_unix_specification_v2/xcu/wc.html

    The wc utility considers a word to be a non-zero-length string of
    characters delimited by white space.

It is not so much a "word" count as a "chunk of non-whitespace" count.
But close enough for counting words in text.

Bob


_______________________________________________
Bug-textutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-textutils

Reply via email to