First of all, export is part of the syntax of POSIX-compatible shells and has no necessary relationship with Linux. It is not a command, but a modifier (similar to declarations like integer, local in bash / zsh).
Secondly, the meaning of export. export var means that the variable var will be inherited by the child process of the shell as the environment variable . By default, variables in POSIX-compatible shells are only used by the shell itself, not environment variables, and will not be inherited by child processes. export var=xxx is the shorthand syntax supported by bash and others. var=xxx cmd is the syntax used to set the var environment variable only for a single command.
Finally, about PATH environment variables. It's an environment variable, meaning it's been exported. PATH, HOME These are environment variables themselves and do not need to be explicitly export. So there is no difference.
Regarding source or ., yes. It means reading and executing the script from the specified file (the path will be searched using the PATH variable, just like the executable file), which is similar to what you manually enter at the shell prompt. The term source isn't just used in shells either.
There is a PATH variable in /etc/profile. What is the difference between PATH=$PATH:/usr/local/php-5.5/bin and export PATH=$PATH:/usr/local/php-5.5/bin?
I think there is no difference. In fact, your /etc/profile will execute source /etc/profile when the system starts, but you will not run it yourself.
First of all,
export
is part of the syntax of POSIX-compatible shells and has no necessary relationship with Linux. It is not a command, but a modifier (similar to declarations likeinteger
,local
in bash / zsh).Secondly, the meaning of
export
.export var
means that the variablevar
will be inherited by the child process of the shell as the environment variable . By default, variables in POSIX-compatible shells are only used by the shell itself, not environment variables, and will not be inherited by child processes.export var=xxx
is the shorthand syntax supported by bash and others.var=xxx cmd
is the syntax used to set thevar
environment variable only for a single command.Finally, about
PATH
environment variables. It's an environment variable, meaning it's beenexport
ed.PATH
,HOME
These are environment variables themselves and do not need to be explicitlyexport
. So there is no difference.Regarding
source
or.
, yes. It means reading and executing the script from the specified file (the path will be searched using thePATH
variable, just like the executable file), which is similar to what you manually enter at the shell prompt. The term source isn't just used in shells either.There is a PATH variable in /etc/profile. What is the difference between PATH=$PATH:/usr/local/php-5.5/bin and export PATH=$PATH:/usr/local/php-5.5/bin?
I think there is no difference. In fact, your /etc/profile will execute source /etc/profile when the system starts, but you will not run it yourself.