Tag Archives: Config File

Generating a Config File

By mora

HI,

I want to append some configuration statements to the existing file in unix to it’s 3 line , 7th line and 28 line.

There is a file generated by our system job, to this I need to add some lines as mentioned below.

DIR=/usr/CDR – line 3
Source=/usr/src – line 7
Target=/usr/tgt – line 28

Please suggest how can I add these about to the specific file generated by other process.

Regards,
Mora

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Pulling Parms from Config File

By phunk

Hello all,

I’m working on a general script for something at work. I’m an up-and-comer backup for a Shell Scripter this company has had for 35 years lol. Anyway, I have a config file I’m trying to pull Variables from as the Config File is used for multiple scripts. Does the below make sense and is there any better way to do this?

Config File:

Code:

DayOfWeek Fri


Script:

Code:

function GetConfigParms
{
DayOfWeek=`grep DayOfWeek app.main.cfg | awk '{print $2}'`
}


I appreciate it!

Source: FULL ARTICLE at The UNIX and Linux Forums