Mercurial > hg > octave-nkf
view libcruft/mkf77def.in @ 6884:1cbb8b606d63
[project @ 2007-09-10 20:43:26 by jwe]
author | jwe |
---|---|
date | Mon, 10 Sep 2007 20:43:27 +0000 |
parents | 2803c70d8d01 |
children | 88df962dc296 |
line wrap: on
line source
#! /bin/sh SED=${SED:-'sed'} AWK=${AWK:-'awk'} F77_TOLOWER=%F77_APPEND_UNDERSCORE% F77_APPEND_UNDERSCORE=%F77_APPEND_UNDERSCORE% F77_APPEND_EXTRA_UNDERSCORE=%F77_APPEND_EXTRA_UNDERSCORE% if $F77_TOLOWER; then case_cmd="tolower"; else case_cmd="toupper"; fi if $F77_APPEND_UNDERSCORE; then uscore="_"; else uscore=""; fi if $F77_APPEND_EXTRA_UNDERSCORE; then awkcmd="$AWK '{ if (\$0 ~ /_/) extra = \"_\"; else extra = \"\"; printf (\"%s%s%s\n\", $case_cmd (\$0), \"$uscore\", extra); }'" else awkcmd="$AWK '{ printf (\"%s%s\n\", tolower (\$0), \"$uscore\"); }'" fi $SED -n \ -e 'y/ABCDEFGHIJLKMNOPQRSTUVWXYZ/abcdefghijlkmnopqrstuvwxyz/' \ -e 's/^\( \| \)[ ]*\(.*function\|subroutine\|entry\)[ ]*\([^ (]*\).*$/\3/p' | \ eval $awkcmd