1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env bash requests=$1 cat <<EOF | gofmt package nslcd_proto type Backend interface { $(sed -rn 's/([^_]+)(.*)/\1\2(Request_\1\2) \1_Enumerator/p' "$requests" | grep -v PAM) $(sed -rn 's/(PAM)(.*)/\1\2(Request_\1\2) \1\2_Enumerator/p' "$requests") } EOF