Skip to content

rodentskie/bash_read_env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

bash_read_env

Read environment variable in bash scripting.

This function allows you to get the value of an env variable

read_var()

First parameter is the ENV variable you want to read.

Second parameter is if you want to specify the .env file to read. (Default is .env)

Usage

Store to a variable like so:

  • my_var=$(read_var VAR)
  • my_var=$(read_var VAR .env.dev)

About

Read environment variable in bash scripting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages