Create small config files from shell variables.
Section: Automation Recipes
Generate config with variable expansion
bash
bash
cat > app.env <<EOF
APP_ENV=${APP_ENV:-dev}
PORT=${PORT:-3000}
EOFExplanation
Common in local setup scripts and container entrypoints.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Automation Recipes