in reply to Shell scripts?

Hi, the difference between a shell script and a perl script is that the first script will/should be interpreted by a shell (sh, bash, ksh, zsh, csh, tcsh ..) and the second one will be interpreted by perl. Perl and Shell-scripting are different languages, and to complicate things further there are different 'dialects' in Shell-scripting. As pointed out, the first line of your script (on UNIX at least) normally contains the interpreter that is used.

For counting the number of lines, your idea is good. On UNIXes (and in cygwin) there is a special utility for counting words/lines etc. thats called wc (abbrev. for word count). wc -l<filename> should give you the number of lines.