I'm trying to learn that if I have to add export statement to set a variable in a bash_profile file . How would I do that ? For example if I have to add export AX = 'name' then should I simply write it at the end of file or do I need to write anything else as well
When you use export , you are adding the variable to the environment variables list of the shell in which the export command was called and all the environment variables of a shell are passed to the child processes, thats why you can use it.
The export command is a built-in utility of Linux Bash shell. It is used to ensure the environment variables and functions to be passed to child processes. It does not affect the existing environment variable. Environment variables are set when we open a new shell session.
The export path is a folder location and a file name. This is where memoQ saves the exported document if you use the Export (stored path) command in the Translations list. To change the export path for a document that is already in the project, use the Change export path window.
Open the . bashrc file in your home directory (for example, /home/your-user-name/. bashrc ) in a text editor. Add export PATH="your-dir:$PATH" to the last line of the file, where your-dir is the directory you want to add.
Simply write export AS='name'
anywhere in your ~/.bash_profile
file:
# Append to the end of the file $ echo "export AS='name'" >> ~/.bash_profile # Update shell $ source ~/.bash_profile
This first command adds the line you want to the file (or just use a text editor) the second updates the shells with the new variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With