#!/bin/sh
for i in *.cfg
do
temp=`awk '/^InputDirectory=/' ${i}`
input_dir=`echo ${temp} | awk '{ print substr( $0, 16) }'`
echo ${input_dir}
done
As you can see its opening each cfg file and searching for the line that has "InputDirectory=" setting that to the temp var and then performing a substring to get the directory path set.
This seems to work fine, but just wondering if there might be a way to combine the 2 lines where awk is used or if there might a simpler solution.