Tutorial 5 Question 7

Problem completing one of the interactive tutorials?

Moderator: drgrussell

Tutorial 5 Question 7

Postby Benji » Sat Feb 04, 2012 3:42 pm

Hi,

I can't figure out how to do this.
I tried lots of things...

grep "*.x.*" | wc /usr/share/dict/words
--> 479829 479829 4953699 /usr/share/dict/words

grep "*x*" | wc /usr/share/dict/words
--> 479829 479829 4953699 /usr/share/dict/words

grep x | wc /usr/share/dict/words
--> 479829 /usr/share/dict/words

None of these numbers work...
Can anyone help me? Tell me where my mistake is?
Thanks a lot.

Benji
Benji
 
Posts: 1
Joined: Sat Feb 04, 2012 12:53 pm

Re: Tutorial 5 Question 7

Postby drgrussell » Sun Feb 05, 2012 3:24 pm

grep x | wc /usr/share/dict/words

This grep has no input so does not do anything and instead wc is the only thing which works.
The grep should have the search file and not wc. Info moves from left to right. So

grep x /usr/share/dict/words | wc -l
drgrussell
Site Admin
 
Posts: 350
Joined: Sat Feb 12, 2005 8:57 pm


Return to Tutorial Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest