I want to gather some information from a config file, but I am strugling with the way to get the information I need.
The config file looks similar to this:
I am not directly asking for a solution but more for an approach on handling files like this.
For instance how would I go about grabbing the re0 information (blue bold)?
The config file looks similar to this:
Code:
groups {
[b][blue]re0 {
system {
host-name my-re0;
}
interfaces {
fxp0 {
description "10/100 Management interface";
unit 0 {
family inet {
address 10.255.2.40/24;
}
}
}
}
}[/blue][/b]
re1 {
system {
host-name my-re1;
}
interfaces {
fxp0 {
description "10/100 Management interface";
unit 0 {
family inet {
address 10.255.2.41/24;
}
}
}
}
}
}
I am not directly asking for a solution but more for an approach on handling files like this.
For instance how would I go about grabbing the re0 information (blue bold)?