Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

envsub file

envsubst < config.txt  

# Expected output:
# server: https://gitlab.com/skofgar
# username: foo_user
# password: mymonkey
Comment

envsub file

envsubst < config.txt > confidential_config.txt
Comment

envsub file

# pipe into less
envsubst < config.txt | less

# pipe a deployment "deploy.yml" into kubectl apply
envsubst < deploy.yml | kubectl apply -f -
Comment

envsub file

# print content of configuration file
cat config.txt

# expected output:
# server: $SERVER_URL
# username: $USER_NAME
# password: $USER_PASSWORD

# load environment variables
source .env

# replace environment variables in file content
envsubst < config.txt

# expected output
# server: https://gitlab.com/skofgar
# username: foo_user
# password: mymonkey

# replace environment variables and write to new file
envsubst < config.txt > confidential_config.txt

# pipe into less
envsubst < config.txt | less

# pipe a deployment "deploy.yml" into kubectl apply
envsubst < deploy.yml | kubectl apply -f -
Comment

PREVIOUS NEXT
Code Example
Shell :: separate a line using sed 
Shell :: linode aapanel info location 
Shell :: adb shell command to rotate screen 
Shell :: from .vendor.pip_shims.shims import InstallCommand 
Shell :: Quick start: Use as a GitHub Pages remote theme 
Shell :: c program to add 1 to each digit of a number 
Shell :: pycache delete bash code 
Shell :: threshold 
Shell :: search css class in all html files 
Shell :: git lfs track folder 
Shell :: digital ocean how to install joomla 16.04 
Shell :: show the number of stars in readme github 
Shell :: fish function to change php version devilbox 
Shell :: snap opera mini install ubuntu 
Shell :: httpd package not found 
Shell :: mkdir mode 
Shell :: cmd echo empty line 
Shell :: terminal run the last x commands 
Shell :: git commit allow empty to trigger ci 
Shell :: update all package jsopn dependencies 
Shell :: linux stderr in strout umleiten 
Shell :: installing through requiirements file 
Shell :: not found the requested url was not found on this server. apache/2.4.41 (ubuntu) server 
Shell :: basic config palo alto cli 
Shell :: cpickle 
Shell :: bash ip l2tp add tunnel 
Shell :: install mariadb ubuntu linixize 
Shell :: fat-free migration 
Shell :: snap jdk 
Shell :: ex: java sr 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =