3

What is the difference between:

PATH=$PATH:/Projects/persevere/bin

and

export PATH=$PATH:/Projects/persevere/bin

I think both are working.

ajsie
  • 77,632
  • 106
  • 276
  • 381

1 Answers1

5

The first line does not export the variable (to the environment variables) unless it is already there.

Bash keeps internal variables accessible only by itself, that is, commands you run don't see them.

For example:

internal_var=hello
export external_var=there
env

The env (which lists environment variables) command won't list internal_var but will list external_var

Adrian Pronk
  • 13,486
  • 7
  • 36
  • 60