How do I grab an INI value within a shell script?
2014-05-10 14:32
344 查看
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
[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
相关文章推荐
- How do I grab an INI value within a Linux shell script?
- 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 sort an array of hashes by a value in the hash?
- How do I sort an array of hashes by a value in the hash?
- How to Run a Custom Shell Script During an XCODE Build
- How do I create an IIS application and application pool using InnoSetup script
- How to write a shell script to check the return value of main()
- How do I add an integer value with javascript (jquery) to a value that's returning a string?
- How to combine the value of multiple hashes within an array by the same key
- How to Run a Custom Shell Script During an XCODE Build
- How do I start an Intent from an OnClickListener
- Apple Technical Note TN2065 -- do shell script in AppleScript 问答集锦
- how do I delete an Eclipse project when I've already deleted the folder and contents?
- How do I remove a particular element from an array in JavaScript?
- How to Create an ALOM CMT Compatibility Shell
- How do I authenticate to send an email
- How do I convert an enum to a list in C#?
- 1201833 - How to configure Crystal Reports to use an SAPLogon.ini file
- How do you make an object in C? Used in RTOS.
- How to secure an Ubuntu 12.04 LTS server - Part 2 The GUI installer script