How do i use a config.txt to recursively pass a set of variables to a shell script
eg my config.txt looks like this :
path=c://dataset/set1
v1= a.bin
v2= b.bin
path=c://dataset/set2
v1= xy.bin
v2= abc.bin
..................
and so on .
and my testscript : (2 Replies)
I need to edit a config file using shell script. i.e., Search with the 'key' string and edit the 'value'.
For eg: below is what I have in the config file "configfile.cfg".
Key1=OldValue1
Key2=OldValue2
I want to search for "Key1" and change "OldValue1" to "NewValue1"
Thanks for your... (7 Replies)
Hello Lads!
Climbing the shell scripting learning curve, i am faced with yet another obstacle! Here's the challenge in front of me :
1) I have 15 servers in a cluster,all of them have the same config files by name : /home/apps/xrm/App_B.cfg
2) The developers change the entries in the... (5 Replies)
I'm writing a shell script. I want to put the variables in a separate config files and use those inside my script.
e.g. the config file (temp.conf)will have the values like
mapping=123
file_name=xyz.txt
I want to access these variables in temp.conf(i.e. mapping and file_name) from inside the... (7 Replies)
Hi,
I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below.
I will be using the config file as mentioned below:
(config.txt)
country:a,b
city:1,2
type:b1... (1 Reply)
Hi folks,
I am trying to configure Apache webserver and also a virtual host inside this webserver.
For Global server config: /var/www/html/index.html
For virtual host config: /var/www/virtual/index.html
Both client10 & www10 are pointing to 192.168.122.10 IP address.
BUT, MY... (1 Reply)
hi
I need to update the value in config.txt value using shell script
example:
lets say a value in config.txt file is as SEQUENCE=1
after some iteration as the loop ends , the SEQUENCE should get update in the config.txt file with a new value of SEQUENCE=2.
also , can anyone please help me... (7 Replies)
Hi Team,
My new build configuration always looking for the files from the build where i copied from.
please help me to resolve this.
I am using Visual studio 2008.It has Qt 4.8. plugins,qml,C++ development
I created new debug_new build configuration with additional preprocessor from the... (1 Reply)
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
LEARN ABOUT DEBIAN
config::general::interpolated
General::Interpolated(3pm) User Contributed Perl Documentation General::Interpolated(3pm)NAME
Config::General::Interpolated - Parse variables within Config files
SYNOPSIS
use Config::General;
$conf = new Config::General(
-ConfigFile => 'configfile',
-InterPolateVars => 1
);
DESCRIPTION
This is an internal module which makes it possible to interpolate Perl style variables in your config file (i.e. $variable or
"${variable}").
Normally you don't call it directly.
VARIABLES
Variables can be defined everywhere in the config and can be used afterwards as the value of an option. Variables cannot be used as keys or
as part of keys.
If you define a variable inside a block or a named block then it is only visible within this block or within blocks which are defined
inside this block. Well - let's take a look to an example:
# sample config which uses variables
basedir = /opt/ora
user = t_space
sys = unix
<table intern>
instance = INTERN
owner = $user # "t_space"
logdir = $basedir/log # "/opt/ora/log"
sys = macos
<procs>
misc1 = ${sys}_${instance} # macos_INTERN
misc2 = $user # "t_space"
</procs>
</table>
This will result in the following structure:
{
'basedir' => '/opt/ora',
'user' => 't_space'
'sys' => 'unix',
'table' => {
'intern' => {
'sys' => 'macos',
'logdir' => '/opt/ora/log',
'instance' => 'INTERN',
'owner' => 't_space',
'procs' => {
'misc1' => 'macos_INTERN',
'misc2' => 't_space'
}
}
}
As you can see, the variable sys has been defined twice. Inside the <procs> block a variable ${sys} has been used, which then were
interpolated into the value of sys defined inside the <table> block, not the sys variable one level above. If sys were not defined inside
the <table> block then the "global" variable sys would have been used instead with the value of "unix".
Variables inside double quotes will be interpolated, but variables inside single quotes will not interpolated. This is the same behavior as
you know of Perl itself.
In addition you can surround variable names with curly braces to avoid misinterpretation by the parser.
SEE ALSO
Config::General
AUTHORS
Thomas Linden <tlinden |AT| cpan.org>
Autrijus Tang <autrijus@autrijus.org>
Wei-Hon Chen <plasmaball@pchome.com.tw>
COPYRIGHT
Copyright 2001 by Wei-Hon Chen <plasmaball@pchome.com.tw>. Copyright 2002-2010 by Thomas Linden <tlinden |AT| cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
VERSION
2.14
perl v5.10.1 2010-12-01 General::Interpolated(3pm)