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

Re: exporting a variable to global shells



On Fri, May 11, 2007 at 12:33:12PM EDT, Bob McGowan wrote:

<snip>

>   3.  in the parent script, where you use your script, change it to be:
> 
>       HTTP_proxy=$(getproxyip)

.. you can take it one tiny step further by using an array:

. child:

cz=($c0 $c1 $c2)    /* .. $c4 .. etc.                            */
echo "${cz[@]}"

. parent:

cz=($(child))       /* note added outer parentheses ..          */

$p0="${cz[0]}"
$p1="${cz[1]}"
$p2="${cz[1]}"

..

I think you need a fairly recent version of bash to do this .. Dunno
about other shells.

Thanks,
cga



Reply to: