Print this page
XXX Remove nawk(1)


  37 # is then declared containing a list of the terminal types and pointers to
  38 # the previous arrays.  Finally, source code for several terminfo routines
  39 # are included that simply access the arrays and return the saved properties.
  40 #
  41 
  42 PATH=/usr/bin; export PATH
  43 
  44 PROGNAME=$(basename "$0")
  45 
  46 usage()
  47 {
  48         echo "Usage: $PROGNAME -s skel -t termio [-v] term ..." >&2
  49         exit 2
  50 }
  51 
  52 extract_section()
  53 {
  54         typeset skel="$1"
  55         typeset secname="$2"
  56 
  57         nawk <$skel -v name=$secname -v skel=$skel '
  58             /\/\* [^ ]* [^ ]* \*\// && $3 == name {
  59                 if ($2 == "BEGIN") {
  60                         printing = 1;
  61                         printf("# %d \"%s\"\n", NR + 1, skel);
  62                 } else {
  63                         printing = 0;
  64                 }
  65                 next;
  66             }
  67 
  68             printing != 0 { print; }
  69         '
  70 }
  71 
  72 verbose=false
  73 termio_c=
  74 terminfo_skel=
  75 
  76 while getopts s:t:v name ; do
  77         case $name in




  37 # is then declared containing a list of the terminal types and pointers to
  38 # the previous arrays.  Finally, source code for several terminfo routines
  39 # are included that simply access the arrays and return the saved properties.
  40 #
  41 
  42 PATH=/usr/bin; export PATH
  43 
  44 PROGNAME=$(basename "$0")
  45 
  46 usage()
  47 {
  48         echo "Usage: $PROGNAME -s skel -t termio [-v] term ..." >&2
  49         exit 2
  50 }
  51 
  52 extract_section()
  53 {
  54         typeset skel="$1"
  55         typeset secname="$2"
  56 
  57         /usr/xpg4/bin/awk <$skel -v name=$secname -v skel=$skel '
  58             /\/\* [^ ]* [^ ]* \*\// && $3 == name {
  59                 if ($2 == "BEGIN") {
  60                         printing = 1;
  61                         printf("# %d \"%s\"\n", NR + 1, skel);
  62                 } else {
  63                         printing = 0;
  64                 }
  65                 next;
  66             }
  67 
  68             printing != 0 { print; }
  69         '
  70 }
  71 
  72 verbose=false
  73 termio_c=
  74 terminfo_skel=
  75 
  76 while getopts s:t:v name ; do
  77         case $name in