Friday, March 24, 2006

Key findings

Haven't blogged bash for a while but then BASH is good :)

Problem: Application A has many config files ( only mutiple lines of key=value type), so one big config file is created merging all the ones(in a very randomized fashion). Now how do you verify that the merged configuration file has not missed out anything.

Solution: A single line of bash code :)

for i in small* ; do while read new; do grep -q ${new%=*} big.cfg || echo ${new%=*} of file $i not found in big.cfg ; done < $i ;done

0 Comments:

Post a Comment

<< Home