"Fossies" - the Fresh Open Source Software Archive

Member "radius-1.6.1/radscripts/radgrep.m4" (15 Dec 2008, 1163 Bytes) of archive /linux/misc/radius-1.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 include(SRCDIR/radscripts.m4)dnl
    2 #! /bin/sh
    3 # NOEDIT
    4 # 
    5 # This file is part of GNU Radius.
    6 # Copyright (C) 2001,2003,2004 Free Software Foundation, Inc.
    7 #
    8 # Written by Sergey Poznyakoff
    9 #
   10 # This file is free software; as a special exception the author gives
   11 # unlimited permission to copy and/or distribute it, with or without
   12 # modifications, as long as this notice is preserved.
   13 #
   14 # GNU Radius is distributed in the hope that it will be useful, but
   15 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
   16 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   17 
   18 RADOPT=
   19 GREPOPT=
   20 VAR=RADOPT
   21 
   22 usage() {
   23     echo "usage: radgrep [radwho-options] [-- grep-options] regexp" 
   24     exit ${1:-0}
   25 }
   26 
   27 # collect arguments for radwho
   28 while TEST($# -ne 0); 
   29 do
   30   case $1 in
   31       OPT_HELP) usage;;
   32       OPT_VERSION)
   33                 echo "$0: PACKAGE_STRING"
   34                 exit 0;;
   35       --)	VAR=GREPOPT # collect grep arguments 
   36                 SHIFT;;
   37       -*) 	eval $VAR=\"\$$VAR $1\"
   38                 SHIFT;;
   39       *)	break;;
   40   esac
   41 done
   42 
   43 if TEST($# -eq 0); then
   44 	usage 1 >&2
   45 fi
   46 radwho $RADOPT | grep $GREPOPT $*
   47 # End of radgrep.m4