home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / programm / 7754 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.8 KB  |  46 lines

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