home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!convex!finger
- From: finger@convex.com (Jay Finger)
- Subject: Re: grepping, fgrepping, and egrepping
- Message-ID: <1992Dec15.171214.643@convex.com>
- Sender: usenet@convex.com (news access account)
- Nntp-Posting-Host: mikey.convex.com
- Organization: CONVEX Computer Corporation, Richardson, Tx., USA
- References: <1992Dec11.01531.7421@ms.uky.edu> <Bz8AB5.7n3@research.canon.oz.au>
- Date: Tue, 15 Dec 1992 17:12:14 GMT
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 30
-
- In article <Bz8AB5.7n3@research.canon.oz.au> andy@research.canon.oz.au (Andy Newman) writes:
- >iguana@mik.uky.edu writes:
- >>Is there anyway to get GREP to take a given string or character
- >>and return the result of validating a string WITHOUT these?
- >>
- >>fgrep -v 'string' <-- will return all LINES that don't have 'string'
- >>in them. But I need a process that will read in a string and output
- >>every character EXCEPT those in the string.
- >>
- >
- >man sed
-
- I don't think he wants sed. What he asked for is to remove every
- *character* except those in the string. He's not looking to remove
- strings, but to remove characters. For this he should use tr(1) with a
- "-d" option.
-
- For example, to remove all characters a,b,c,d from a file, pipe it through
- the following:
-
- tr -d abcd
-
- Of course, depending on what's in the string, you may want to quote it.
-
- jay
- --
- ===============================================================================
- Jay Finger - finger@convex.com | Convex Computer Corp
- CONVEX System Integration and Support | 3000 Waterview Parkway
- Product Specialist | Richardson, TX 75080
-