help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] How to understand "set --"?


From: Peng Yu
Subject: [Help-bash] How to understand "set --"?
Date: Tue, 18 Feb 2014 22:12:26 -0600

Hi,

"help set" says

      --  Assign any remaining arguments to the positional parameters.
          If there are no remaining arguments, the positional parameters
          are unset.

But it seems that the above definition is not clear enough to explain
the following output. Can anybody provide a better definitive
explanation of "set --"? Should it be better to interpret the single
quote in $x when "set --" is called?

~/linux/test/bash/man/builtin/set/--$ x="'abc def'"
~/linux/test/bash/man/builtin/set/--$ set -- $x
~/linux/test/bash/man/builtin/set/--$ printf "%s\n" "$@"
'abc
def'

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]