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
HOBBITLAUNCH.CFG(5)						File Formats Manual					       HOBBITLAUNCH.CFG(5)

NAME
hobbitlaunch.cfg - Task definitions for the hobbitlaunch utility SYNOPSIS
~xymon/server/etc/hobbitlaunch.cfg DESCRIPTION
The hobbitlaunch.cfg file holds the list of tasks that hobbitlaunch runs to perform all of the tasks needed by the Xymon monitor. FILE FORMAT
A task is defined by a key, a command, and optionally also interval, environment, and logfile. Blank lines and lines starting with a hash mark (#) are treated as comments and ignored. Long lines can be broken up by putting a back- slash at the end of the line and continuing the entry on the next line. An entry looks like this: [hobbitd] ENVFILE /usr/local/xymon/server/etc/hobbitserver.cfg CMD /usr/local/xymon/server/bin/hobbitd [updateweb] ENVFILE /usr/local/xymon/server/etc/hobbitserver.cfg CMD /usr/local/xymon/server/bin/bbgen NEEDS hobbitd GROUP webupdates INTERVAL 5m ONHOST localhost MAXTIME 10m LOGFILE /var/log/xymon/updateweb.log The key is enclosed in angle brackets, and must be unique for each task. You can choose your key-names as you like, they are only used internally in hobbitlaunch to identify each task. The command is defined by the CMD keyword. This is the full command including any options you want to use for this task. This is required for all tasks. The DISABLED keyword means that this command is disabled. hobbitlaunch will not start this task. It is recommended that you use this to disable standard tasks, instead of removing them or commenting them out. Upgrades to Xymon will add standard tasks back into the file, so unless you have them listed as DISABLED then tasks may re-appear unexpectedly after an upgrade. The ONHOST keyword tells hobbitlaunch that this task should only run on specific hosts. After the ONHOST keyword, you must provide a "regu- lar expression"; if the hostname where hobbitlaunch runs matches this expression, then the task will run. If it doesn't match, then the task is treated as if it were DISABLED. The MAXTIME keyword sets a maximum time that the task may run; if exceeded, hobbitlaunch will kill the task. The time is in seconds by default, you can specify minutes, hours or days by adding an "m", "h" or "d" after the number. By default there is no upper limit on how long a taskmay run. The NEEDS instructs hobbitlaunch not to run this task unless the task defined by the NEEDS keyword is already running. This is used e.g. to delay the start of some application until the needed daemons have been started. The task that must be running is defined by its key. The GROUP keyword can be used to limit the number of tasks that may run simultaneously. E.g. if you are generating multiple pagesets of webpages, you dont want them to run at the same time. Putting them into a GROUP will cause hobbitlaunch to delay the start of new tasks, so that only one task will run per group. You can change the limit by defining the group before the tasks, with a "GROUP groupname max- tasks" line. The INTERVAL keyword defines how often this command is executed. The example shows a command that runs every 5 minutes. If no interval is given, the task is only run once - this is useful for tasks that run continually as daemons - although if the task stops for some reason, then hobbitlaunch will attempt to restart it. Intervals can be specified in seconds (if you just put a number there), or in minutes (5m), hours (2h), or days (1d). The ENVFILE setting points to a file with definitions of environment variables. Before running the task, hobbitlaunch will setup all of the environment variables listed in this file. Since this is a per-task setting, you can use the same hobbitlaunch instance to run e.g. both the server- and client-side Xymon tasks. If this option is not present, then the environment defined to hobbitlaunch is used. The ENVAREA setting modifies which environment variables are loaded, by picking up the ones that are defined for this specific "area". See hobbitserver.cfg(5) for information about environment areas. The LOGFILE setting defines a logfile for the task. hobbitlaunch will start the task with stdout and stderr redirected to this file. If this option is not present, then the output goes to the same location as the hobbitlaunch output. SEE ALSO
hobbitlaunch(8), hobbitd(8), xymon(7) Xymon Version 4.2.3: 4 Feb 2009 HOBBITLAUNCH.CFG(5)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy