Getting The Properties Variable Values From bashrc File
Posted By Ekesh Bahuguna | 29-Jun-2018
Need: Properties file may contain sensitive information like password, emailed etc. If such information is defined in the properties file, anyone who has access to our code can know server location, email, password etc.
Set the properties variable
file as follows: (such as values of property variables will not visible directly, rather saved in
2- export the variables that need to be set into
3- Save the file
4- Reflect the changes done in
5- Check from terminal whether
if [ -z "$MAIL_HOST" ]
echo "not defined"
If MAIL_HOST is properly set to
6- Access the configuration set into
Benefits of approach:
When we set the information
This approach reduces the code for setting multiple profiles. Moreover, this is a secure way to access sensitive information. Now if anyone has access to our code is not eligible to access our security details such as email and password.
Note: To reflect the changes done in