09-07-2006
I think this is what you are looking for....let me know if it is not.
(Assuming you are using sh or ksh)
in your config file do stuff like....
# This is the configuration file for XXX
# Please place double quotes around all entries that have spaces in there
# values after the equals sign, ie FileList="file1 file2 file3"
#
#This parameter is the name of the logfile
logfile=/tmp/log.out
#
#
# TEMPORARY INCREMENT FILE
pivot='"tmp/.fileCount"
#
# CONNECTING STRING
# Place user name here
USERNAME=aaaaa
#
#Place passwd here
PASSWORD=bbbbb
#
#Place Dbname here
DBNAME=xxxxx
#
#this is the end of the config file
Now in your MAIN script all you do is....
#!/bin/sh
# This is my main script
# First need to source the config file
# if we can not read the cfg then exit!
if [ -r /path/to/config.cfg ]
then
# getting config file
. /path/to/config.cfg
else
echo "Can not read config.cfg
exit 99
fi
echo "$logfile"
echo "$pivot"
echo "$USERNAME"
echo "$PASSWORD"
echo "$DBNAME"
You can use "." or the "eval" inside your main script to source the information from your config file depends how and what you are sourcing
Hope this is what you are after
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
pls help..
I need to get the ESSID value for athx
this is the config file..
pls help (7 Replies)
Discussion started by: esham
7 Replies
2. Shell Programming and Scripting
Hi ,
a:) i have configuration file with pattren
<Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output>
eg:
myfile.confg
9899000000,9899999999,DATA,b.dat
9899000000,9899999999,SMS,a.dat
b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies
3. Shell Programming and Scripting
Hello All,
I have a config file which has the following data :
export DBCHECKSUM001="/home/srvcdesk/DBCheckSum/DBCheckSum001.cfg"
export DBCHECKSUM002="/home/srvcdesk/DBCheckSum/DBCheckSum002.cfg"
export DBCHECKSUM003="/home/srvcdesk/DBCheckSum/DBCheckSum003.cfg"
export... (1 Reply)
Discussion started by: Veenak15
1 Replies
4. Shell Programming and Scripting
Hi All,
I have a requirement to parse a file.
Let me clear you all on the req.
I have a job which contains multiple tasks and each task will have multiple attributes that will be in the below format. Each task will have some sequence number according to that sequence number tasks shld... (0 Replies)
Discussion started by: rajeshorpu
0 Replies
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
hi all
please give me some idea about how to send xml file from one c++ pgm to other pgm. (1 Reply)
Discussion started by: shubhig15
1 Replies
8. UNIX Desktop Questions & Answers
Hi Guys
If i go to
systems -> Preferances -> Look and Feel -> Windows
i can click on the radio box for "Super (or "Windows Logo")
is there a config file i can change it in instead
i can not find it
thanks
Adam (0 Replies)
Discussion started by: ab52
0 Replies
9. UNIX for Dummies Questions & Answers
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... (2 Replies)
Discussion started by: mora
2 Replies
10. Red Hat
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)
Discussion started by: freebird8z
1 Replies