James on Sat, 26 Jul 2003 11:13:12 -0400 |
I am looking for a way to use variable substitution with environment variables. My /etc/environment looks like this: NUM_X=6 X1="some value" X2="some value" X3="some value" X4="some value" X5="some value" X6="some value" Trying to keep things dynamic, I would like to print out all values of X(n) by using a 'for' statement, which goes like this: $num = $ENV{'NUM_X'}; for ($i = 1; $i <= $num; $i++) { printf ("%15s\n", $ENV{'X[$i]'}); } How would I go about getting the $i with 'X' environment variable so I can print out X1 thru X6? TIA, James __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - **Majordomo list services provided by PANIX <URL:http://www.panix.com>** **To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|