•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,423 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,609 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1034 | Replies: 4
![]() |
hi DW Shell Script Kings 
i have some problem in a step of my assignment.
thats i can read the file with this :
how i can find the total lines which is in this file ??
i mean like this : if the file has student names , it must output like this :
Total students : x
Thanks for helping..

i have some problem in a step of my assignment.
thats i can read the file with this :
#Read all text from file echo -n "Enter file name: " read fileName while read inputline do echo $inputline done < $fileName
how i can find the total lines which is in this file ??
i mean like this : if the file has student names , it must output like this :
Total students : x
Thanks for helping..
Last edited by jamshid : Apr 12th, 2007 at 10:00 am.
Impossible is Nothing
•
•
Join Date: Feb 2007
Location: Bangalore, India
Posts: 535
Reputation:
Rep Power: 4
Solved Threads: 50
•
•
Join Date: Apr 2006
Posts: 140
Reputation:
Rep Power: 3
Solved Threads: 26
well, don't even have to use wc.
number_of_line=$(awk 'END {print NR}' file)![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- problems with reading random access line from a file (C++)
- how to remove a number of lines from a text file ? (Python)
- # of lines in a text file (Java)
- noob questions- ifstream ofstream (C++)
- Easy one (I think)! (C++)
- Text File Input and manipulation (C++)
- cannot find bridge.dll file at start up (Viruses, Spyware and other Nasties)
Other Threads in the Shell Scripting Forum
- Previous Thread: Arrays
- Next Thread: case statement (meaning of this block of code)



Linear Mode