简体   繁体   English

如何使用Shell脚本读取Nginx样式的配置文件

[英]How to read a nginx style config file using shell script

I am writing a shell script only application. 我正在编写一个仅用于shell脚本的应用程序。 I would like to read file a nginx style config file (like the one below): 我想读取一个nginx样式的配置文件(如下所示):

some_block {
    variable1 value1;
    variable2 value2;

    config_array1 value3 {
        sub_variable1 value1;
        sub_variable2 value2;
    }
}

Basically I am trying to make a backup system that would read a similar config file as above. 基本上,我正在尝试制作一个备份系统,该系统将读取与上述类似的配置文件。 I searched a lot, but didn't find any help on reading any complex config file as above. 我进行了很多搜索,但在读取上述任何复杂的配置文件时没有找到任何帮助。 Any help appreciated. 任何帮助表示赞赏。

在仔细阅读了所有评论和一些讨论之后,我知道仅使用Shell是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM