How do I grab an INI value within a shell script?
来源:互联网 发布:linux cat 分页 编辑:程序博客网 时间:2024/05/17 07:44
I have a parameters.ini file, such as:
[parameters.ini]
database_user = user
database_version = 20110611142248
I want to read in and use the database version specified in the parameters.ini file from within a bash shell script so I can process it.
#!/bin/sh
# Need to get database version from parameters.ini file to use in script
php app/console doctrine:migrations:migrate %DATABASE_VERSION%
How would I do this?
one of more possible solutions
dbver=$(sed -n 's/.*database_version *= *\([^ ]*.*\)/\1/p' < parameters.ini)
echo $dbver
0 0
- How do I grab an INI value within a Linux shell script?
- How do I grab an INI value within a shell script?
- How do I get a preference value?
- How do I set a preference value?
- How do I install a Package Manager within Cygwin ?
- How do I sort an array of hashes by a value in the hash?
- How do I add an integer value with javascript (jquery) to a value that's returning a string?
- How do I make my GUI plot into an axes within the GUI figure rather than inside of a new figure in M
- How do I pass data between Activities/Services within a single application?
- How do I use the locate command within a specified directory?
- PHP + MySql + Stored Procedures, how do I get access an "out" value?
- How do I generate a SQL script from my diagram in MySQL Workbench?
- How can I run an EXE from within my application?
- How do I access a nested JSON(嵌套JSON) value using Alamofire and SwiftyJSON
- How do I bind the values of an enum to a ComboBox?
- How do I open an editor on a file outside the workspace?
- How do I open an editor on something that is not a file?
- How do I find a particular class from an Eclipse plug-in?
- 递归树结构
- “半杯水”的哲学
- 等着我
- mark
- TCP的流量控制
- How do I grab an INI value within a shell script?
- 黑马程序员_javaIO流
- ubuntu mysql 配置
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 2014年5月5日 国企的反腐风暴
- BoundsChecker使用说明(代码调试)
- 一个老工程师给年轻工程师的十大忠告
- 自己写的一个自动化测试任务执行工具(模板)
- [Node.js]在windows下不得不防的小错误