[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep help, how do i make this shorter?
From: |
Bob Proulx |
Subject: |
Re: grep help, how do i make this shorter? |
Date: |
Thu, 31 Jan 2008 15:52:46 -0700 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
UniXman1234 wrote:
> ./new1a < numbers.txt | grep -i -v '^a ' | grep -i -v '^the ' | grep -i -v
> '^or ' | sort -f
>
> How would I go about merging all the greps into a scripe and putting all the
> words that should be excluded into a data file
Many different ways. Look at the 'grep -f' option. Look at using sed.
> so i would be able to execute it like
>
> ./new < numbers.txt | exclude | sort -f
Here is one possibility.
./new < numbers.txt | grep -v -f exclude.txt | sort -f
HTH,
Bob