about summary refs log tree commit diff stats
path: root/fucktrain
blob: 1c25aff752a9d5c765667f621fbb3f1857381e28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# TRAINFUCK: CHOO CHOO MUTHAFUCKA -*- sh -*-
# Author: Case Duckworth <acdw@acdw.net>
# License: WTFPL
# Version: #9

### Commentary:

# shell wrapper around fucktrain.awk, which see.

### Code:

FUCKTRAIN="$(dirname "$0")/fucktrain.awk"

case "$(realpath "$(command -v awk)")" in
*gawk)
	AWK=gawk
	EXTRA_AWK_ARGS="--characters-as-bytes" # --posix overrides
	;;
*mawk)
	AWK=mawk
	EXTRA_AWK_ARGS="-Wposix"
	;;
*)
	AWK=awk
	EXTRA_AWK_ARGS=
	;;
esac

"$AWK" -v EXE_NAME="$(basename $0)" -f "$FUCKTRAIN" $EXTRA_AWK_ARGS -- "$@"