Record / Memo
sh で共通化のため、設定値ファイルを source で読み込み使用する。
例) test_source.sh ・・・ 読み込まれるファイル(設定値を記載) test.sh ・・・ 読み込むファイル(設定値を使用) # test_source.sh ファイル source_value=’hell
例)
test_source.sh ・・・ 読み込まれるファイル(設定値を記載)
test.sh ・・・ 読み込むファイル(設定値を使用)
# test_source.sh ファイル
source_value='hello source'
# test.sh ファイル
#! /bin/bash
source ./test_source.sh
echo $source_value
# 実行
$ ./test.sh
hello source※読み込まれる test_source.sh の権限設定は不要