concept

End of options

Standalone -- ends option parsing for a parser that supports it. Remaining tokens are operands. It must be consumed by the appropriate parser, and is not universally supported by every executable.

Formal Syntax & Structure

bash syntaxbash
--

Return Value

argument boundary

Standalone -- ends option parsing for a parser that supports it. Remaining tokens are operands. It must be consumed by the appropriate parser, and is not universally supported by every executable.

Working Example

Example Snippetbash
printf 'draft\n' > ./-draftshow() {    if [[ ${1-} == -- ]]; then shift; fi    if (( $# != 1 )); then return 2; fi    cat -- "$1"}show -- -draft
Bash Reference