The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   count lines in bash script (http://hintsforums.macworld.com/showthread.php?t=72327)

hayne 06-20-2007 04:32 PM

Quote:

Originally Posted by cwtnospam (Post 387319)
Hmm, maybe it's only omitting the first line because it's calling the bash shell in these files

I think the problem is that there is no end-of-line character at the end of the last line in those text files. I think 'wc -l' merely counts the number of new-line characters in the file.
I.e. it's nothing to do with the # character.

If you don't understand what I mean, look at the contents of those files using something like 'hexdump'.
You can usually configure your editor to always have a new-line at the end of a text file (that you create with that editor) - this is a good idea.


All times are GMT -5. The time now is 05:41 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.