Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey.!
I have a file f3.txt
It contains --
The American Revolution.
This is the best solution to the problem
PanAmerica Capital Group
the american people
ddd
United States of America
america
the brown fox jumped over a lazy dog.
Creative thinking
I want to write a command using grep to list all the lines that contain words having exactly 1 vowel.
??
It seems that this has to be homework, and we are not here to do your work for you. We can help with specific queries, but we are not going to spoon feed you answers. Thanks.
i tried using
grep -iw ".\?[aeiou]\?" f3.txt
the problem that i'm having is that when i type in the above command it searches for a specific number of letters in a word.
I want it to work for any word(having any number of letters) that fits my condition.
Oddly enough, I get different results when I use word boundries and -w.
(I hope it's ok to post what I have now)
Code:
$ egrep '\<[^aeiou]*[aeiou][^aeiou]*\>' file
The American Revolution.
This is the best solution to the problem
the american people
United States of America
the brown fox jumped over a lazy dog.
$ echo "$text" | egrep -iw '[^aeiou]*[aeiou][^aeiou]*'
The American Revolution.
This is the best solution to the problem
the american people
United States of America
the brown fox jumped over a lazy dog.
I cannot figure out why it's not matching every single-vowel word in the second case.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.