tech-userlevel archive

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

Re: shell quoting



    Date:        Wed, 9 Sep 2026 10:28:30 +0200
    From:        Edgar Fu�<ef%math.uni-bonn.de@localhost>
    Message-ID:  <aqEYrjGSnjUsqrY/@trav.math.uni-bonn.de>

  | > I think the first "local" statement should be:
  | > 	local names="$1"
  | > Otherwise the function might be tricked by
  | How? There's no recursive expansion in shell.

In the function there is, the "set -- $names" (where $names is unquoted)
will expand whatever "names" has been set to, and if it were possible to
get it set to something unexpected, by having a file called:
	names=whatever-i-want
in ".", then 'whatever-i-want' will be expanded by the "set" statement).

So, the quoting really should be included there (one of the possible ways).

kre



Home | Main Index | Thread Index | Old Index