Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the begining or end of line

Posted By: Lorelei Schmidt     Category: Unix / Linux / Ubuntu     Views: 2656

Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the begining or end of line

Code for Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the begining or end of line in Unix / Linux / Ubuntu

echo Enter filename
read filename
grep -v ^[[:space:]] $filename | grep -v [[:space:]]$ | grep '.....'
  
Share: 



Lorelei Schmidt
Lorelei Schmidt author of Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the begining or end of line is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!