Nicolas Williams wrote: > On Wed, Jun 04, 2008 at 09:05:24AM -0700, Mike Shapiro wrote: > > On Wed, Jun 04, 2008 at 09:21:40AM -0500, Nicolas Williams wrote: > > > On Tue, Jun 03, 2008 at 10:59:52PM -0700, Mike Shapiro wrote: [snip] > - sh > > Outputs shell code to be eval'ed that sets variables with names like > <pg>_<prop>_type=<prop value type> > <pg>_<prop>_count=<count of values> > <pg>_<prop>_<index>=<value #index> > > Use like so: > > eval `svcprop -o sh ...` > > - ksh88, bash > > Like sh, but with <pg>_<prop>_values being a regular array. > > eval $(svcprop -o ksh ...)
Arrgglggllwwwlll... ;-( Plese _AVOID_ "eval" at all cost. Your're just asking for quick way which leads to trouble by attributary code execution and very hard-to-debug problems (even David Korn himself suggested to avoid "eval" at all costs (and he provided lots of alternatives, e.g. for variable assigments with a varname name defined by another variable ksh93 supports "nameref", e.g. $ nameref x="PS1" ; x=" >>" ; will set the variable "PS1" to the value " >>" ). And if we're lucky the next POSIX shell standard just declares "eval" as depreciated). ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;)