github.com/nibnait/go-learn@v0.0.0-20220227013611-dfa47ea6d2da/src/pkg/mod/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c/plan9/mksysnum_plan9.sh (about)

     1  #!/bin/sh
     2  # Copyright 2009 The Go Authors. All rights reserved.
     3  # Use of this source code is governed by a BSD-style
     4  # license that can be found in the LICENSE file.
     5  
     6  COMMAND="mksysnum_plan9.sh $@"
     7  
     8  cat <<EOF
     9  // $COMMAND
    10  // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
    11  
    12  package plan9
    13  
    14  const(
    15  EOF
    16  
    17  SP='[ 	]' # space or tab
    18  sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \
    19  	< $1 | grep -v SYS__
    20  
    21  cat <<EOF
    22  )
    23  EOF