in Education by
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? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Use the below command using awk version=$(awk -F "=" '/database_version/ {print $2}' parameters.ini) As per your question, this single liner will grab your ini value within the shell script This is useful for basic INI files, if it has 2 [parameters.ini] this will return the value twice And to remove that we can use specialized ini parser like crudini.

Related questions

0 votes
    I need SSH access to an Amazon EC2 instance running Ubuntu. All I have is the Amazon username and password. Any ideas? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    The following script I have saved in an .sh file on the server that clears a few directories of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    Suppose I have a bunch of "homegeneous" sc-files, and I need to execute one specific sequence of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    Within a python script can I call an external command? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I'm starting a bash script which will take a path in S3 (as specified to the ls command) and dump the ... finding which does it? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I installed Ubuntu 12.04 on my instance and am trying to install packages using apt-get, but I am getting the ... do I fix this? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I have a report for year-month entries like below 201703 5 201708 10 201709 20 201710 40 201711 80 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a report for year-month entries like below 201703 5 201708 10 201709 20 201710 40 201711 80 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 3, 2022 in Education by JackTerrance
0 votes
    I have a report for year-month entries like below 201703 5 201708 10 201709 20 201710 40 201711 80 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I want to list the public IP addresses of my EC2 instances using Bash, separated by a delimiter (space or ... something else entirely? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I was wondering if there was a way (at least on Ubuntu, which I am using) to have Emacs "always ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I was wondering if there was a way (at least on Ubuntu, which I am using) to have Emacs "always ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    I was wondering if there was a way (at least on Ubuntu, which I am using) to have Emacs "always ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    How can I find where my httpd.conf file is located? I am running an Ubuntu Linux server from the Amazon Web ... find my Apache config. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    What's the preferred way to determine if a given ksh invocation is running an interactive shell? I have ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
...