当前位置:网站首页>Crudini profile editing tool
Crudini profile editing tool
2022-07-07 06:19:00 【Hua Weiyun】
Crudini yes Pádraig Brady use Python Developed 、 Used to correct ini Tools for editing configuration files .
crud yes 4 Acronyms of words , namely create、read、update and delete, Chinese translated into “ Additions and deletions ”. This is the most common form of data 4 Class operation method .
install
# centosyum install -y crudini
Grammar format
crudini --set [OPTION]... config_file section [param] [value] crudini --get [OPTION]... config_file [section] [param] crudini --del [OPTION]... config_file section [param] [list value] crudini --merge [OPTION]... config_file [section]
Common parameters :
--get | Get the section or key value in the configuration file |
--set | set key value |
--merge | Merge profile |
--format=FMT | by --get Use , Select the output format . The format is sh,ini,lines |
--inplace | Lock and write file , There are fewer restrictions than the default replacement |
--list | by --set and --del, Update a list ( aggregate ) Value |
--list-sep=STR | Use custom characters instead of the default comma |
--output=FILE | Write output to file .’-“ Indicates standard output ” |
--verbose | Indicate on the error output whether changes have been made |
Example
Get a key value
# obtain nova.conf The configuration file TEST section abc Value of key crudini --get nova.conf TEST abc
Get a value that is not in the section
crudini --get nova.conf '' abc
Get the key of a section
crudini --get nova.conf DEFAULT
Add or update a value that is not in the section
crudini --get nova.conf '' abc 456
Add or update a key value
# Set up cinder.conf file DEFAULT section auth_strategy Key value is keystonecrudini --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
Update an existing key value ( If the variable does not exist, it will return “Parameter not found:”):
crudini --set --existing /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
Delete a key
# Delete nova.conf The configuration file DEFAULT section abc key crudini --del nova.conf DEFAULT abc
Delete a section
# Delete nova.conf The configuration file TEST section crudini --del nova.conf TEST
Merge profile
# take test1.ini Merge into test.inicrudini --merge test.ini < test1.ini
# The output can be determined by shell Parsed section eval $(crudini --get --format=sh config_file section)# from shell Variable update ini file echo name="$name" | crudini --merge config_file section# Use standards UNIX Text processing compares two ini file diff <(crudini --get --format=lines file1.ini|sort) \ <(crudini --get --format=lines file2.ini|sort)
边栏推荐
- Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens
- Several key steps of software testing, you need to know
- ETCD数据库源码分析——从raftNode的start函数说起
- [SOC FPGA] peripheral PIO button lights up
- 从“跑分神器”到数据平台,鲁大师开启演进之路
- 骑士战胜魔王(背包&dp)
- Experience of Niuke SQL
- Jstat of JVM command: View JVM statistics
- The boss always asks me about my progress. Don't you trust me? (what do you think)
- @pathvariable 和 @Requestparam的详细区别
猜你喜欢
Rk3399 platform development series explanation (WiFi) 5.52. Introduction to WiFi framework composition
Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens
Jinfo of JVM command: view and modify JVM configuration parameters in real time
JVM monitoring and diagnostic tools - command line
@Detailed differences between pathvariable and @requestparam
JVM command - jmap: export memory image file & memory usage
Rk3399 platform development series explanation (WiFi) 5.53, hostapd (WiFi AP mode) configuration file description
uniapp开发小程序如何使用微信云托管或云函数进行云开发
Open the blue screen after VMware installation
3428. Put apples
随机推荐
How to keep accounts of expenses in life
Qtthread, one of many methods of QT multithreading
Value range of various datetimes in SQL Server 2008
693. Travel sequencing
When we talk about immutable infrastructure, what are we talking about
谷歌 Chrome 浏览器发布 103.0.5060.114 补丁修复 0-day 漏洞
VScode进行代码补全
Three updates to build applications for different types of devices | 2022 i/o key review
Party A's requirements for those who have lost 800 yuan
3428. Put apples
POI excel export, one of my template methods
Jstat of JVM command: View JVM statistics
[SQL practice] a SQL statistics of epidemic distribution across the country
云加速,帮助您有效解决攻击问题!
Experience of Niuke SQL
Qt多线程的多种方法之一 QThread
Change the original style of UI components
New Year Fireworks code plus copy, are you sure you don't want to have a look
Audio distortion analysis of DSP and DAC based on adau1452
Cf:c. column swapping [sort + simulate]