You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dirs=('a''b''c')
if [[ !"${dirs[@]}"=~"${1}" ]];then# do somethingfi
Verify if Environment Variable is Defined
if [[ !-z"$MYENV" ]];then# $MYENV definedfi
Replace All Environemnt Variables Inside File (Templating Using Bash)
functionenvsubst_config_file {
if [[ !-f"$1" ]];thenecho"File $1 not found"exit 1
fi
filename=$(basename -- "$1")
filedir=$(dirname -- "$1")echo"Replacing envs in file $filename in dir $filedir"
cat $1| envsubst >$filedir/out/$filename
}