Sponsored Content
Full Discussion: Config file auto-updation
Top Forums Shell Programming and Scripting Config file auto-updation Post 302787303 by PikK45 on Friday 29th of March 2013 06:57:03 AM
Old 03-29-2013
HP Config file auto-updation

Hello All,

I need to update my .cfg file which is used in the script for almost all runs.

myfile.cfg file:
Code:
var=1
var1=1
run=0

script:
Code:
#! /bin/sh

. /mydir/myfile.cfg

echo $var"\t" $var1

exit

So, the requirement is that the myfile.cfg should update every time I run the script. say run=1 and in the next run run=2 and go on.

I was thinking to do with sed. But it would need a temporary file as my system doesn't support -i.
 

9 More Discussions You Might Find Interesting

1. Programming

Directory updation Notification?

Hi, I'm a UNIX newbie .. so forgive me if this question sounds dumb. :) Is it possible for Unix to notify a process that a particular directory has been updated? Rather that the process constantly polling the directory ... Awaiting your replies .. Thanks, VJ (6 Replies)
Discussion started by: vjsony
6 Replies

2. Linux

gcc updation on Linux machine

Hi All, I already have gcc complier installed in my machine. Its version is : gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I am not sure whethere it's is latest gcc version available. I want to update my gcc version. Can anyone please suggest me what is the latest and stable gcc... (1 Reply)
Discussion started by: bisla.yogender
1 Replies

3. Shell Programming and Scripting

parsing config file to create new config files

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)
Discussion started by: clazzic
1 Replies

4. AIX

Problem with updation of 'quota'

Hi, We have recently implemented 'quota' concept for the unix users. softlimit - 230MB hardlimit - 250MB We have applied the quota when few of users are more than the hardlimit,issue is that even though the users cleared the space, still its 'quota' was not updating properly. For some... (0 Replies)
Discussion started by: girish_satyam
0 Replies

5. Shell Programming and Scripting

to check files updation in sys time

Dear All, Pls help me on this issue. i want to write a script to check whether files updation happening in cuttent time or not. i have set of files in directory which wil update in time basis.. Requirement: If the files are updating in system time i just want to print "files are... (6 Replies)
Discussion started by: steve2216
6 Replies

6. Shell Programming and Scripting

check files updation

Hi All, Can anyone help to write the script to check files updation? i have files as mentioned below. which will be updated some time. i just want to check the last file is updating the data for last 15 mins or not. if its not updating i want to print NOT OK. if its updating data i want... (1 Reply)
Discussion started by: steve2216
1 Replies

7. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

8. UNIX for Dummies Questions & Answers

Check for updation/error/stuck of logs

Hi All, I'm a newbie in Linux Programming.:) Got some 500 processes running and I have around 20-30 logs updating for every 2mins on a server. The logs which i'm referring usually contains book name,run ids(not PID's),process name etc etc. I'm interested in finding out whether some particular... (1 Reply)
Discussion started by: Nand Kishor
1 Replies

9. UNIX for Dummies Questions & Answers

File updation on matching key

I have input file like Input.dat with below content RRD 0Z91YUn000000Lk 9000100001 103020151117 STMT151117155527001 0000 2 000000 000004 RRD 0Z91YUn00000ysj 9000100001 103020151117 STMT151117155527001 0000 3 000000 000003 RRD 0Z91YUn00001vGh 9000100002... (12 Replies)
Discussion started by: PRAMOD 96
12 Replies
Apache::TestConfig(3)					User Contributed Perl Documentation				     Apache::TestConfig(3)

NAME
Apache::TestConfig -- Test Configuration setup module SYNOPSIS
use Apache::TestConfig; my $cfg = Apache::TestConfig->new(%args) my $fh = $cfg->genfile($file); $cfg->writefile($file, $content); $cfg->gendir($dir); ... DESCRIPTION
"Apache::TestConfig" is used in creating the "Apache::Test" configuration files. FUNCTIONS
genwarning() my $warn = $cfg->genwarning($filename) genwarning() returns a warning string as a comment, saying that the file was autogenerated and that it's not a good idea to modify this file. After the warning a perl trace of calls to this this function is appended. This trace is useful for finding what code has created the file. my $warn = $cfg->genwarning($filename, $from_filename) If $from_filename is specified it'll be used in the warning to tell which file it was generated from. genwarning() automatically recognizes the comment type based on the file extension. If the extension is not recognized, the default "#" style is used. Currently it support "<!-- -->", "/* ... */" and "#" styles. genfile() my $fh = $cfg->genfile($file); genfile() creates a new file $file for writing and returns a file handle. If parent directories of $file don't exist they will be automagically created. The file $file and any created parent directories (if found empty) will be automatically removed on cleanup. A comment with a warning and calls trace is added to the top of this file. See genwarning() for more info about this comment. my $fh = $cfg->genfile($file, $from_file); If $from_filename is specified it'll be used in the warning to tell which file it was generated from. my $fh = $cfg->genfile($file, $from_file, $nowarning); If $nowarning is true, the warning won't be added. If using this optional argument and there is no $from_file you must pass undef as in: my $fh = $cfg->genfile($file, undef, $nowarning); writefile() $cfg->writefile($file, $content, [$nowarning]); writefile() creates a new file $file with the content of $content. A comment with a warning and calls trace is added to the top of this file unless $nowarnings is passed and set to a true value. See genwarning() for more info about this comment. If parent directories of $file don't exist they will be automagically created. The file $file and any created parent directories (if found empty) will be automatically removed on cleanup. write_perlscript() $cfg->write_perlscript($filename, @lines); Similar to writefile() but creates an executable Perl script with correctly set shebang line. gendir() $cfg->gendir($dir); gendir() creates a new directory $dir. If parent directories of $dir don't exist they will be automagically created. The directory $dir and any created parent directories will be automatically removed on cleanup if found empty. Environment Variables The following environment variables affect the configuration and the run-time of the "Apache::Test" framework: APACHE_TEST_COLOR To aid visual control over the configuration process and the run-time phase, "Apache::Test" uses coloured fonts when the environment variable "APACHE_TEST_COLOR" is set to a true value. APACHE_TEST_LIVE_DEV When using "Apache::Test" during the project development phase, it's often convenient to have the project/lib (live) directory appearing first in @INC so any changes to the Perl modules, residing in it, immediately affect the server, without a need to rerun "make" to update blib/lib. When the environment variable "APACHE_TEST_LIVE_DEV" is set to a true value during the configuration phase ("t/TEST -config", "Apache::Test" will automatically unshift the project/lib directory into @INC, via the autogenerated t/conf/modperl_inc.pl file. Special Placeholders When generating configuration files from the *.in templates, special placeholder variables get substituted. To embed a placeholder use the "@foo@" syntax. For example in extra.conf.in you can write: Include @ServerRoot@/conf/myconfig.conf When extra.conf is generated, "@ServerRoot@" will get replaced with the location of the server root. Placeholders are case-insensitive. Available placeholders: Configuration Options All configuration variables that can be passed to "t/TEST", such as "MaxClients", "DocumentRoot", "ServerRoot", etc. To see the complete list run: % t/TEST --help and you will find them in the "configuration options" sections. NextAvailablePort Every time this placeholder is encountered it'll be replaced with the next available port. This is very useful if you need to allocate a special port, but not hardcode it. Later when running: % t/TEST -port=select it's possible to run several concurrent test suites on the same machine, w/o having port collisions. AUTHOR
SEE ALSO
perl(1), Apache::Test(3) perl v5.18.2 2015-06-18 Apache::TestConfig(3)
All times are GMT -4. The time now is 08:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy