Can any1 suggest me, how to implement the "wc" word counting utility through bash shell script, i.e how to design a script working similar to "wc" command ??? Need it desperately, with all relevant options like -l, -c, -w ...
mahul000 0 Newbie Poster
Recommended Answers
Jump to PostAnother option: grep.
You have to show effort before we do your homework for you.
There is also a sed one hunk of code that does it as well.
You can also use a while ... do .. done loop.
Jump to PostSince the homework deadline has gone by and somebody may search.
One simple way with sed
# using sed for wc -l sed -n '$=' filename
All 6 Replies
masijade 1,351 Industrious Poster Team Colleague Featured Poster
mahul000 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
jim mcnamara 19 Junior Poster
jim mcnamara 19 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.