Reputation: 26422
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?
Upvotes: 1
Views: 428
Reputation: 532518
--
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.
Upvotes: 5