tech-userlevel archive

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

Re: proposed /etc/rc.d/staticroute change to allow variables



On Wed, 19 Oct 2011, Tracy Di Marco White wrote:
I misunderstood what Alan was suggesting. So, staticroute_doit should be this:

Yes, that's what I had in mind.  Although, looking at it again now,
I'd add double quotes to the args in all the evals, not just the
new one.

Like this:

                              [ $2 = "add" ] && eval "${args#*+}"
[...]
                              [ $2 = "delete" ] && eval "${args#*-}"
[...]
                              eval "${args#*!}"
[...]
                              eval "route -q $2 -$args"

The quotes in the eval make a difference if the string to be eval'd contains spaces or other IFS characters in a context where the difference between exactly one space and some other amount of white space is important.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index