Skip to content

Instantly share code, notes, and snippets.

@zaourzag
Created March 26, 2022 01:17
Show Gist options
  • Save zaourzag/60ac4fdc793591aa2a7a3ba71d814a47 to your computer and use it in GitHub Desktop.
Save zaourzag/60ac4fdc793591aa2a7a3ba71d814a47 to your computer and use it in GitHub Desktop.
Bash script to generate configuration file from template
OPTION_1=${OPTION_1}
OPTION_2=${OPTION_2}
OPTION_3=${OPTION_3}
OPTION_4=${OPTION_4}
OPTION_5=${OPTION_5}
#!/usr/bin/env bash
# do something and set the options
OPTION_1=foo
OPTION_2=bar
OPTION_3=lorem
OPTION_4=ipsum
OPTION_5=dolor
# generate config file
eval "echo \"$(cat conf.tpl)\" > xxx.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment