Created
July 16, 2018 06:41
-
-
Save zeeshanalisyed/13897ef88cf6da7e9c70393c945c8709 to your computer and use it in GitHub Desktop.
bash function sets the environment variable
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
| #!/bin/bash | |
| # @description: add this file to path /bin/ | |
| # set_env_var variable_name variable value | |
| VAR=$1 | |
| VAL=$2 | |
| set_env_v () { | |
| echo 'export '$1'='$2 >> /home/$USER/.bashrc | |
| } | |
| set_env_v $VAR $VAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment