0

There are already answered questions (e.g. this one) about the point of export in bash but something I haven't seen explained and have long wondered about is why some people imply that the export should be done separately. I've seen examples like:

name=value; export name

whereas I would always use:

export name=value

as it's neater and more concise. I've never experienced any unexpected side-effects from exporting and initialising the variable at the same time.

Is there a difference between the two? Is there a nuance I'm missing?

Community
  • 1
  • 1
IpsRich
  • 672
  • 10
  • 22

0 Answers0