share
Unix & LinuxMeaning of -- in set command in shell script
[0] [0] Esha
[2020-04-16 08:50:59]
[ shell-script set ]
[ https://unix.stackexchange.com/questions/580419/meaning-of-in-set-command-in-shell-script ]

What is the meaning of set -- $PATH in shell script? Is this the same as set echo "$PATH" ? What is the significance of -- here?

This is NOT a duplicate. The referenced thread states the usual usage of this arg. It does not answer this question precisely. The bash set command has a specific defined use for both -- and - : The -- unsets all existing positional arguments. The - signals the end of options to set, and the beginning of options to be changed in the shell as a whole. - Paul_Pedant