The Shell comparison configuration file

Source: Internet
Author: User

Performance testing, you may change the environment to change, each time the test, the configuration file is different, may cause the test to fail.

Suppose there is a correct configuration file for Zoo.cfg.template, and the configuration file for the test environment is ZOO.CFG

So how do you compare the above two and find out the configuration errors in zoo.cfg?

The following code should be able to

#!/bin/bash#by Hzwuboxiaocat $ | While read Linedo    key=$ (echo $line | sed-e ' s/\ (. *\) =\ (. *\)/\1/g ')    if [-Z ' $key]; then continue    fi    Val  ue=$ (echo $line | sed-e ' s/\ (. *\) =\ (. *\)/\2/g ')    value_correct=$ (grep $key $ | sed-e ' s/\ (. *\) =\ (. *\)/\2/g ')    if ["$value" X! = "$value _correct" x];then       echo $ (grep $key $1;grep $key $)    Fidone

  

The Shell comparison configuration file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.