The Bash profile files are used to define environment variables, such as the directories in the $PATH variable and the users default editor, such as vi or nano in the $EDITOR variable. For example, a very simply Bash profile file may contain something like this.
export EDITOR=/usr/bin/vi export PATH=$PATH:/usr/local/bin
User personal Bash profile file
Each user will have their own personal Bash profile file, like this.
The users personal Bash profile file will take precedence over the global, system wide Bash profile file.
Global Bash profile file
On a Red Hat distribution, the global Bash profile file is /etc/profile This file reads scripts in the /etc/profile.d directory. For example, the following script could be used to set the $EDITOR variable to use the vi editor.
The vi-default-edtior.sh script could contain something like this.
#!/bin/sh if [ -z "$EDITOR" ]; then export EDITOR=/usr/bin/vi fi