xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/poundbang.sh (revision e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c)
1#!/bin/bash
2
3if [[ -z "$AWK" || -z "$WORKDIR" ]]; then
4    printf '$AWK and $WORKDIR must be set\n' >&2
5    exit 1
6fi
7
8SCRIPT=$WORKDIR/test.temp.run
9cat > $SCRIPT <<EOF
10#!$AWK -f 
11{ print }
12EOF
13
14chmod a+rx $SCRIPT
15printf 'a\nb\nc\nd\n' | $SCRIPT
16