The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/port/mkextract

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #!/bin/rc
    2 
    3 switch($#*){
    4 case [012]
    5         echo usage: mkextract [-u] field n file... >[1=2]
    6         exit 1
    7 }
    8 
    9 switch($1){
   10 case -u
   11         flag=$1; shift
   12 case *
   13         flag=''
   14 }
   15 
   16 field=$1
   17 n=$2
   18 shift 2
   19 
   20 fn select {
   21         awk '
   22 
   23                 BEGIN                   { doprint=0 }
   24                 /^$/                    { next }
   25                 /^#/                    { next }
   26                 doprint && /^[^ ]/      { doprint=0 }
   27                 doprint                 { print $'^$n^' }
   28                 $1 ~ "^'^$field^'$"     { doprint=1; next }
   29         ' $*
   30 }
   31 
   32 switch($flag){
   33 case -u
   34         select $* | sort -u
   35 case *
   36         select $*
   37 }

Cache object: 89786f97f9b7334963fe811af18f9262


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.