#!/bin/sh stawk() { awk -f subtext.awk "$@" # SUBTEXT AWK SCRIPT HERE } usage() { cat>&2 <&2 'Unknown option -%s\n' "$OPTARG"; usage 1 ;; (*) usage 1 ;; esac done } main() { configure "$@" shift $((OPTIND-1)) stawk -vsopath="$ST_SOPATH" "$@" | if "$ST_PIPE_SH" then sh else cat fi } die() { ec="$1"; shift printf >&2 '!! %s\n' "$*" exit "$ec" } main "$@"