10-03-2007
Config file use in Shell Programs...
I wanted to know the format everyone uses for cfg files that are called by shell programs. I do mostly sh and ksh scripts and many times I'm modifying an existing script to do another task.
Recently I have been making my scripts more generic and using configuration files to hold uniq details. Thus making modification quick and easy.
Currently, I use a CSV "like" format for my scripts. I would like something that is more human readable and meaningful with larger number of entries. XML would over complicate things but I have been looking into YAML. Does anyone have any feed back or suggested best practices on configuration files used in shell programs?
Thanks,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how to write pipe for finding out the login names and login time of the users whose login name begins with p. (1 Reply)
Discussion started by: rameshparsa
1 Replies
2. Shell Programming and Scripting
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)
Discussion started by: pradsh
2 Replies
3. Shell Programming and Scripting
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)
Discussion started by: rajeshomallur
7 Replies
4. Shell Programming and Scripting
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)
Discussion started by: badrimohanty
7 Replies
5. UNIX for Dummies Questions & Answers
Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies
6. 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
7. 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
8. UNIX for Advanced & Expert Users
What files or programs have the ability to change your default network scripts and config files? All 3 of these very important files got changed on their own.
/etc/sysconfig/network-scripts/ifcfg-wlan0
/etc/sysconfig/networking/devices/ifcfg-wlan0... (4 Replies)
Discussion started by: cokedude
4 Replies
9. Shell Programming and Scripting
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)
Discussion started by: ravidwivedi2288
7 Replies
10. UNIX for Dummies Questions & Answers
Hey guys,
Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries.
However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies
LEARN ABOUT DEBIAN
ttf2ufm_x2gs
TTF2UFM_X2GS(1) TTF2UFM Font Converter TTF2UFM_X2GS(1)
NAME
ttf2ufm_x2gs - font installer for Ghostscript
SYNOPSIS
ttf2ufm_x2gs [config-file]
DESCRIPTION
The fonts generated with ttf2ufm work fine with Ghostscript by themselves. The script `x2gs' (or `ttf2ufm_x2gs' when installed into a
public directory, to avoid name conflicts with other programs) links the font files from the X11 direcotry into the Ghostscript directory
and automatically creates the description file ("Fontmap") in Ghostscript format.
If the configuration file is not specified as an argument then the file `"convert.cfg"' in the current directory is used, just like the
`"convert"' script does. Indeed, this configuration file is used for both scripts.
The Ghostscript-related parameters in the configuration file are:
"DSTDIR" - the X11 font directory used by `"x2gs"' as the source of the fonts. This parameter is common with the X11 configuration.
"GSDIR" - the base directory of Ghostsript. If this parameter is set to an empty string then `"convert"' won't call `"x2gs"'. So if you
want to get only the X11 fonts installed then set this parameter to an empty string. This directory may vary on various system, so please
check your system and set this value accordingly before running the script.
"GSFONTDIR" - the font directory of Ghostscript. In the standard Ghostscript installation it's a subdirectory of "GSDIR" but some systems
may use completely different directories.
"GSCONFDIR" - the configuration subdirectory of Ghostscript that contains the "Fontmap" file.
"INSTALLFONTMAP" - if the value is set to "YES" then install the entries for the new fonts right into the main "Fontmap" file. Otherwise
just leave the file "Fontmap.ttf" in the Ghostscript configuration directory.
After preparing the configuration file run the script. It symbolicaly links all the font files and creates the description file
"Fontmap.ttf" in "GSCONDFIR". After that there are two choices.
If the option "INSTALLFONTMAP" was set to "YES" then the font descriptions are also automatically installed into the master "Fontmap" file.
The script is clever enough to detect if it was run multiple times with the same directories and if so it replaces the old "Fontmap"
entries with the new ones instead of just accumulating all of them. You may also run it multiple times for multiple X11 directories and all
the results will be properly collected in the "Fontmap". But it's your responsibility to watch that the names of the font files don't
overlap. If the X11 font directory gets renamed then you have to remove its font entries from the "Fontmap" and only after that re-run
`"x2gs"' for the new directory.
On the other hand if the option "INSTALLFONTMAP" was set to "NO" then go to the "GSCONFDIR" directory and insert the contents of
"Fontmap.ttf" into the "Fontmap" file manually. This step may be left manual to make the installation a little bit more safe.
After that you may also want to redefine some of the aliases in "Fontmap" to refer to the newly installed fonts. But the redefinition of
the aliases may be dangerous if the width of characters in the new font will be different from the old font. Alas, there is no visible
solution of this problem yet.
FILES
o TTF2UFM_SHAREDIR/scripts/convert.cfg.sample
o TTF2UFM_SHAREDIR/scripts/*
o TTF2UFM_SHAREDIR/README
o TTF2UFM_SHAREDIR/FONTS
o TTF2UFM_SHAREDIR/*
o TTF2UFM_BINDIR/ttf2ufm
SEE ALSO
o ttf2ufm(1)
o ttf2ufm_convert(1)
o t1asm(1)
version 3.4.4 December 31, 2003 TTF2UFM_X2GS(1)