1

I was attempting to export a bash environment variable of a path with a dash in it when I came across the -- argument of bash. I noticed that it's seemly similar to how one checks out a single file of some version in in git.

Is there any relation between the two, are they the same thing, do they severe the same purpose?

myradio
  • 1,645
  • 1
  • 14
  • 23
leeand00
  • 24,318
  • 34
  • 129
  • 277

1 Answers1

5

-- is not anything specific to bash; it is a convention that many commands follow when processing their arguments. The convention is that no argument appearing after -- should be treated as an option, even if there is an option by that name.

This convention is recommended as Guideline #10 in the POSIX Utility Syntax Guidelines.

John Kugelman
  • 330,190
  • 66
  • 504
  • 555
chepner
  • 446,329
  • 63
  • 468
  • 610