Skip to content

Shell script is used to read property value from a file easily

Notifications You must be signed in to change notification settings

chungxon/load_properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load Properties Script

This helpful script is used to read properties from a file for use in another script

Usage

1. loadProperties function

  • Call the function with the properties file and an optional prefix

    loadProperties "$1" "$2"
  • Example usage: loadProperties examples/example.properties

  • Example accessing the properties: echo "App Name: $appName"

2. getProperty function

  • Call the function with the properties file and the property key

    getProperty "$1" "$2"
  • Example usage: appName=$(getProperty examples/example.properties appName)

  • Example accessing the property: echo "App Name: $appName"

Demo

image

About

Shell script is used to read property value from a file easily

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages