Results 1 to 9 of 9
I'm looking to write a sample shell script that counts the number of distinct words in a text file given as Argument.
Remark: White space characters are spaces, tabs, form ...
- 08-18-2008 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
counts the number of distinct words
I'm looking to write a sample shell script that counts the number of distinct words in a text file given as Argument.
Remark: White space characters are spaces, tabs, form feeds, and new lines.
JUST with this commands tr, sort, grep. wc.
Thanks.
- 08-18-2008 #2That's a pretty arbitrary limitation, but it sure makes for a good assignment. It tests your ability to come to a conclusion with limited resources.JUST with this commands tr, sort, grep. wc.
When does your instructor say this assignment is due?--
Bill
Old age and treachery will overcome youth and skill.
- 08-18-2008 #3Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Probably followed this one...
Please note the Forum Rules
4. No homework questions
- 08-18-2008 #4Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
Hi,
No this not HW and second i try many times and then i posted here to get a help and that is my try to solve it:
grep -c | sort -u test.txt | tr -d "\t \v \f [
unct:] [:upper:] "
but actually i don't know how i can sort this commands ??
- 08-18-2008 #5
Why are you restricted to using tr, sort, grep, and wc?
--
Bill
Old age and treachery will overcome youth and skill.
- 08-18-2008 #6Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
Because just this commands i can work with them clearly and plus ther is many references i found it on the net explain how i can used, so now i know how i can use this commands but i don't know how i can combine them.
- 08-18-2008 #7Registered Linux user #270181
TechieMoe's Tech Rants
- 08-18-2008 #8Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
I will try thank you techieMoe
- 08-19-2008 #9Linux Newbie
- Join Date
- Jul 2008
- Posts
- 181


Reply With Quote
