Sponsored Content
Top Forums Shell Programming and Scripting Accessing Variables from .conf file Post 302158882 by insamniac on Wednesday 16th of January 2008 02:01:32 PM
Old 01-16-2008
can't you just source the file like this
Code:
#!/usr/bin/ksh

. usermon.conf     #reads the file into the current script

usermon.conf should contain something like this:
Code:
myvar1="whatever1"
myvar2="whatever2"
myvar3="whatever3"

if you're not using ksh, you'll want to use 'source' instead of '.'

i could be completely wrong... i need to install unix at home so i can
verify the crap i'm trying to remember from work!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

accessing variables declared in another perl script

Hi all, I have a perl script which declares two variables and calls another perl script which accesses those variables. But I am unable to access the variables in the called script. My script is as follows: my $ENV{a}="20"; system("perl called.pl"); and my called.pl contains: print... (3 Replies)
Discussion started by: gurukottur
3 Replies

2. Shell Programming and Scripting

accessing ksh variables from awk

hi everybody! i am running this ksh script for replacing a set of strings by another set of new ones. i am getting both these from a file. also, the strings that i want to replace, are sub-strings(can occur more than once in each chunk) in a big chunk of data that i have bulk-copied(bcp utility)... (1 Reply)
Discussion started by: trupti wagh
1 Replies

3. Programming

accessing unix variables in oracle

Hi, consider the following script. ip='***.***.**.**' user='****' pw='******' ftpresults=`ftp -nv $ip<<EOF user $user $pw cd /home/oracle/practice size $1 bye EOF` fname=$1 echo $ftpresults sqlplus -s tms/tms@dev45 <<"EOF" insert into remote_file_sizes (file_name,file_size)... (1 Reply)
Discussion started by: ravi raj kumar
1 Replies

4. Shell Programming and Scripting

Accessing Shell Variables in awk or sed

Hello, I wonder if it is possible to pass and use variables from shell environment into sed or awk. I am trying to achieve something similar to the following using sed or awk: var=some_regular_expression grep "$var" filename # Will extract lines from filename The following code,... (3 Replies)
Discussion started by: nasersh
3 Replies

5. Shell Programming and Scripting

Problem in accessing variables outside shell

Hi, I have a shell script wherein i am doing some file operations and storing the data in some variables. I am exporting these variables as i need to use them outside shell. Then within the shell i am launching GDB session hoping that i will be able to access the exported variables in the GDB... (2 Replies)
Discussion started by: jsantosh
2 Replies

6. UNIX for Advanced & Expert Users

Accessing PL/SQL OUT variables in Korn Shell Script

Hello All, I was just wondering if there is any direct way to access PL/SQL OUT variables from Korn Shell Script. I could already figure out how to return a single value back from PL/SQL to Shell Script (using bind variable). But, what if we want to return multiple values? One option I... (4 Replies)
Discussion started by: bright_future
4 Replies

7. Solaris

basic question on sd.conf and lpc.conf file

Hello Guys, Do we need to configure this file only if we add SAN disk or even if we add local disk, do we need to modify? (4 Replies)
Discussion started by: mokkan
4 Replies

8. Shell Programming and Scripting

Accessing variables outside the function

I have the below code to find yesterdays date, In this I want to make MONTH, DAY and YEAR as global variableand use it outside the {}, but I am unable to do so , please assist: #!/usr/bin/ksh date '+%m %d %Y' | { read MONTH DAY YEAR DAY=`expr "$DAY" - $1` case "$DAY" in 0) ... (1 Reply)
Discussion started by: mohsin.quazi
1 Replies

9. Shell Programming and Scripting

PERL on windows accessing variables from a config file

Folks, I'm a perl moron, so please speak very slowly. : ) I'm modifying a build script that starts up an apache server. Now there is a .config file that hardcodes an old webserver path like this c:\oldWebserver. Now I don't want that hardcoded value, rather wish to use an... (3 Replies)
Discussion started by: MarkoRocko
3 Replies

10. Programming

GDB problem accessing static variables in C

Hi, Can anyone explain this please..... This is on AIX with GDB (tried a few versions). It only happens when program compiled in 64 bit and only with static variables.... A simple test program... ### snip #include <stdio.h> main() { static int n; n = 6; printf("hello %d\n", n);... (0 Replies)
Discussion started by: bagpussnz
0 Replies
DEVSCRIPTS.CONF(5)						File Formats Manual						DEVSCRIPTS.CONF(5)

NAME
devscripts.conf - configuration file for the devscripts package DESCRIPTION
The devscripts package provides a collection of scripts which may be of use to Debian developers and others wishing to build Debian pack- ages. Many of these have options which can be configured on a system-wide and per-user basis. Every script in the devscripts package which makes use of values from these configuration files describes the specific settings recognised in its own manpage. (For a list of the scripts, either see /usr/share/doc/devscripts/README.gz or look at the output of dpkg -L devscripts | grep /usr/bin.) The two configuration files are /etc/devscripts.conf for system-wide defaults and ~/.devscripts for per-user settings. They are written with bash(1) syntax, but should only have comments and simple variable assignments in them; they are both sourced (if present) by many of the devscripts scripts. Variables corresponding to simple switches should have one of the values yes and no; any other setting is regarded as equivalent to the default setting. All variable names are written in uppercase, and begin with the script name. Package-wide variables begin with "DEVSCRIPTS", and are listed below, as well as in the relevant manpages. For a list of all of the available options variables, along with their default settings, see the example configuration file /usr/share/doc/devscripts/devscripts.conf.ex. This is copied to /etc/devscripts.conf when the devscripts package is first installed. Information about configuration options introduced in newer versions of the package will be appended to /etc/devscripts.conf when the pack- age is upgraded. Every script which reads the configuration files can be forced to ignore them by using --no-conf as the first command-line option. PACKAGE-WIDE VARIABLES The currently recognised package-wide variables are: DEVSCRIPTS_CHECK_DIRNAME_LEVEL, DEVSCRIPTS_CHECK_DIRNAME_REGEX These variables control scripts which change directory to find a debian/changelog file or suchlike, and some other miscellaneous cases. In order to prevent unwanted, even possibly dangerous, behaviour, these variables control when actions will be performed. The scripts which currently make use of these variables are: debc, debchange/dch, debclean, debi, debrelease, debuild and uscan, but this list may change with time (and I may not remember to update this manpage). Please see the manpages of individual scripts for details of the specific behaviour for each script. SEE ALSO
devscripts(1) and /usr/share/doc/devscripts/README.gz. AUTHOR
This manpage was written for the devscripts package by the package maintainer Julian Gilbey <jdg@debian.org>. DEBIAN
Debian Utilities DEVSCRIPTS.CONF(5)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy