newbie help on small shell script
I've got a fair few router configs backed up to a directory on one of my unix hosts.
They are backed up to /home/configs/<router name>/<router name>.cnfg.
What i'am hoping for is a script that can create a list of routers that have a certain line in their config. eg (all routers with 'e1' in their configs)
I was thinking the logical steps i need to take are
1. create list of directorys in /home/configs directory
2. somehow create script to "cat /<router name>/<router name>.cnfg | grep e1" and then IF e1 exists in the config copy the routers name to a file.
3. contine until all the configs are finished, appending routers it finds with "e1" in the config to the file.
But i've got no idea how to actually archive this
Can anyone suggest a script to do this, or a better way of doing this?