Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: setting var=value from an array element  (Read 7083 times)

0 Members and 1 Guest are viewing this topic.

Jim Theisen

  • Guest
setting var=value from an array element
« on: October 29, 2004, 09:52:25 AM »
I've parsed STDIN down to and array whose elements are "name=value" (looks like cgi because it is). I know how to do this in perl but want to do it in Linux. Here's what perl does:
$contents{$name} = ${value}
This sets the literal value in name as a variable containing the value value: i.e.; age=30  
I want to use array[n]'s name as the variable name and set it equal to the arrays value element.