how to


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to
# 1  
Old 02-16-2010
how to

I want to read the values between the quote marks in the first line (i.e. e10 , e11, e12, and so on ...)
then put them at the end of the string (i.e. base_config_ ) before the ="

Read e10 e11 e12 and so on
Place them at the end of base_config_ then the rest of the line ="abc 255.255 "


Code:
 
base_config_as="e10 e11 e12 e13 v"

base_config_a_e10="abc 255.255.255.0.0"
base_config_a_e11="abc 255.255.255.0.0"
base_config_a_e12="abc 255.255.255.0.0"
base_config_a_e13="abc 255.255.255.0.0"
base_config_a_v="abc 255.255.255.0.0"

How would I do that?

Last edited by jim mcnamara; 02-16-2010 at 05:32 PM.. Reason: code tags
# 2  
Old 02-16-2010
Code:
for i in $base_config_as; do
    echo base_config_a_$i='"255.255.255.0.0"'
done

Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question