LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-16-2001, 10:23 AM   #1
elibm
LQ Newbie
 
Registered: Jul 2001
Posts: 2

Rep: Reputation: 0
Question Script, Reading a file, When end of file?


Hello everybody,

I am a new Linux user, I am creating a small script to read a file and count the number of lines that it has, so I do bucle read while is not the end of the file, but I do not know how to find out
when the end of the file has been reach.

Can somebody help me?

Thanks.
Elias.
 
Old 07-16-2001, 10:30 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
Was this just a shell scripting experiment? If so ignore this! If not, and you actually need to count the number of lines in a file how about
Code:
wc -l myFile
cheers

Jamie...
 
Old 07-16-2001, 11:01 AM   #3
elibm
LQ Newbie
 
Registered: Jul 2001
Posts: 2

Original Poster
Rep: Reputation: 0
Yes, it is a shell scripting experiment, but is very usefull what you
told me because now I can do a bucle that stops when the last line has been read.

Thanks.

EliBM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a conf file from a BASH script dinolinux Programming 5 08-03-2005 04:18 AM
Pop3 Command stream end of file while reading line sesimonsen Linux - Networking 0 05-13-2005 12:29 PM
Bash script - reading from text file twantrd Programming 4 11-24-2004 12:38 AM
reading file, bash script marri Programming 3 11-15-2004 09:13 AM
my script has no end of file!?? box_l Programming 4 07-26-2004 05:18 AM


All times are GMT -5. The time now is 04:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration