I need to write both variables like ${myvar} and their values.
This code makes no substitutes and writes text as is:
cat >${PROGNAME_APPDIR}/AppRun <<'EOF'
#!/bin/bash
HERE=$(dirname $(readlink -f "${0}"))
export LD_PRELOAD="${HERE}"/lib/exec_wrapper.so
export BIN_DIR="${HERE}${DIR}"
exec "${BIN_DIR}"/binary "$@"
EOF
When I change << 'EOF' to << EOF the code substitutes all. But I need substitute just value of ${DIR}.
How to make a mixed write without crazy coding?