IN="$(mktemp --suffix .erl)" cat > "$IN" # Because escript ignores the very first line (why…). sed -i "1i " "$IN" escript "$IN"