• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Count lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Count lines


  • Subject: Re: Count lines
  • From: "John W. Baxter" <email@hidden>
  • Date: Fri, 12 Nov 2004 15:14:12 -0800

On 11/12/2004 14:04, "Paul Berkowitz" <email@hidden> wrote:

> which works perfectly. (In fact it gives the answer "1" when there's a Mac
> file with no LFs. whereas wc -l says the answer is "0", which is
> interesting.)

Very often, a last line effectively doesn't exist if it does not have its
trailing newline.  And if the file as Mac line endings, it doesn't have any
newlines to the wc program, so it is entirely an unterminated last line.
(Lots of editors force the newline to be there, or can be configured to.  In
the current BBEdit, for example, the relevant checkbox is in the "Text
Files: Saving" preference pane.)

/etc/crontab is one such file...you edit in a last line, forget to end it
with return (keystroke...which implants a newline), and it does nothing.
(Lots of the /etc/crontab files here at work end with a comment line saying
to put new stuff above this line...it doesn't matter whether that line
"exists" or not as far as the results are concerned.)

Perl until a few years ago had some interesting consequences of this
"problem"...it's been "fixed."

  --John
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Count lines (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Count lines
  • Next by Date: Re: Count lines
  • Previous by thread: Re: Count lines
  • Next by thread: Re: Count lines
  • Index(es):
    • Date
    • Thread