LoginSignup
0
0

More than 1 year has passed since last update.

【Linux】テキストを環境変数の値に置き換える方法【envsubst】

Posted at

テキストを環境変数の値に置き換える方法

envsubstコマンドを使用することでテキストを環境変数の値に置き換えられます。
以下のように使用します。

sample.template
${GREETING}
ターミナル
$ export GREETING=Hello && envsubst < ./sample.template > ./sample.txt

または

$ GREETING=Hello envsubst < ./sample.template > ./sample.txt

sample.txt
Hello
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0