Freddy Vulto <fvu...@gmail.com> writes: > On 09:11, Steven W. Orr wrote: >> typeset $1 && upvars -a$nn $1 "${aval[@]}" >> >> The implication seems to be that the typeset command can fail. Is >> this a reasonable thing to worry about? > > The idea is that a typeset - besides declaring a variable local - > protects upvars from malicious variable names: > > $ typeset 'ls -l' > bash: typeset: `ls -l': not a valid identifier > $ echo $? > 1
Unfortunately, that is subverted by the unquoted use of $1 above. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."