1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/sh set -eu usage() { cat <<-'EOF' Usage: pre PREFIX < STDIN EOF } PREFIX="${1:-}" eval "$(assert-arg -- "$PREFIX" 'PREFIX')" # FIXME: using "while" so we avoid GNU sed's buffering while read -r line; do printf '%s: %s\n' "$PREFIX" "$line" done