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,703
  • 1
  • 15
  • 25
leeand00
  • 25,510
  • 39
  • 140
  • 297

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
  • 349,597
  • 67
  • 533
  • 578
chepner
  • 497,756
  • 71
  • 530
  • 681