home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / ease-3.5 / utils / cfstrip.csh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1991-02-26  |  594 b   |  27 lines

  1. #!/bin/csh -f
  2. # usage:
  3. #    cfstrip <infile >outfile
  4. # Bruce Barnett
  5. #
  6. # this file strips out all comments from a sendmail.cf file
  7. # it also converts 
  8. #    <tab>[whitespace]     to     <tab>
  9. #    <space>[whitespace]    to    <space>
  10. #    <space>$        to    $
  11. #    <space><        to    <
  12. #    <space>@        to    @
  13. if ( $#argv != 0 ) then
  14.     echo no arguments are allowed
  15.     exit 1
  16. endif
  17. sed -e 's/^#.*//' \
  18.     -e 's/^\(R[^    ]*[    ][    ]*[^    ]*\)[    ]*.*$/\1/' \
  19.     -e 's/^\(R[^    ]*[    ][    ]*[^    ]*\)[    ]*$/\1/' \
  20.     -e 's/^\(R[^    ]*[    ][    ]*[^    ]*\)$/\1/' \
  21.     -e 's/    [     ]*/    /g' \
  22.     -e 's/ [     ]*/ /g' \
  23.     -e 's/ \$/$/g' \
  24.     -e 's/ </</g' \
  25.     -e 's/ @/@/g' \
  26.      |grep -v '^[     ]*$'
  27.