Sponsored Content
Top Forums Shell Programming and Scripting Fetching variable from config file Post 302835995 by rafa_fed2 on Tuesday 23rd of July 2013 11:06:38 AM
Old 07-23-2013
Quote:
Originally Posted by Corona688
Is .profile in /, yes or no? If not, it won't find it there, you'll need to tell it somewhere else.
In dev enviroment it is there.In production i dont know .Thats is my i am storing it in the configuration file.i will tell them to change it.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Read a config file and Assign to Variable

I have removeConfig file, it contains the dir paths for removing. I need to read line by line and assign to variable. any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies

2. Shell Programming and Scripting

Exporting variable from config file

Hi, I am exporting the environment variable from config file, but when I echo the variable it does not display any value. Here is the snippet of the code #!/bin/sh export ENVIRONMENT_ROOT_DIRECTORY="/cb/$ENVIRONMENT" echo $ENVIRONMENT_ROOT_DIRECTORY ${JAVA_HOME}/bin/java... (2 Replies)
Discussion started by: bhavnabakshi
2 Replies

3. Shell Programming and Scripting

how to read the variable from config file

how to read the variable from config file eg: a.cfg below config file config file which contain a=`hostname` b=250 a.sh is shell script echo "$a and $b" if i run "a.sh 1.cfg" it works but when i declare N number of variable it wont works.. can u please suggest for that ? (1 Reply)
Discussion started by: mail2sant
1 Replies

4. 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

5. Shell Programming and Scripting

Parse config file data to script variable

I have a script with few pre defined variables. Also have a config file. Something like this. # config file # Define Oracle User MOD1_TAG=abcde MOD2_TAG=xyzabc MOD3_TAG=def I need to parse the config file and have each of the value copied to different variables. Please suggest what... (1 Reply)
Discussion started by: souryadipta
1 Replies

6. 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

7. Shell Programming and Scripting

how to read the variable indivdually from config file

how to read the variable indivdually ( line by line ) in shell script eg : i have the config file where contain cat /home/user01/ilap/conf/input.conf node.txt node2.txt node3.txt i need to run script like /home/user01/ilap/exe/run.sh /home/user01/ilap/conf/input.conf ... (1 Reply)
Discussion started by: mail2sant
1 Replies

8. Shell Programming and Scripting

Query on fetching a value of variable in script

I have below 3 files in a directory : oktest.txt okcode.txt okfun.txt I was writing a small shell script to just print the names of three files where I took a variable a and assigned it a value ok. a=ok echo "Three files are : $atest.txt $acode.txt $afun.txt" But when I run... (3 Replies)
Discussion started by: simpltyansh
3 Replies

9. Shell Programming and Scripting

Access another variable config variable

Hi all, Please help me on my problem. I want to take a value of variable which the variable is in other file. variable.sh wesly=1 wina=2 wekin=3 variabletaker.sh source variable.sh echo $wesly when i run the variabletaker.sh the error result is like here error (3 Replies)
Discussion started by: weslyarfan
3 Replies

10. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
APT-CONFIG(8)								APT							     APT-CONFIG(8)

NAME
apt-config - APT Configuration Query program SYNOPSIS
apt-config [--empty] [--format '%f "%v";%n'] [-o=config_string] [-c=config_file] {shell | dump | {-v | --version} | {-h | --help}} DESCRIPTION
apt-config is an internal program used by various portions of the APT suite to provide consistent configurability. It accesses the main configuration file /etc/apt/apt.conf in a manner that is easy to use for scripted applications. Unless the -h, or --help option is given, one of the commands below must be present. shell shell is used to access the configuration information from a shell script. It is given pairs of arguments, the first being a shell variable and the second the configuration value to query. As output it lists shell assignment commands for each value present. In a shell script it should be used as follows: OPTS="-f" RES=`apt-config shell OPTS MyApp::options` eval $RES This will set the shell environment variable $OPTS to the value of MyApp::options with a default of -f. The configuration item may be postfixed with a /[fdbi]. f returns file names, d returns directories, b returns true or false and i returns an integer. Each of the returns is normalized and verified internally. dump Just show the contents of the configuration space. OPTIONS
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean options you can override the config file by using something like -f-,--no-f, -f=no or several other variations. --empty Include options which have an empty value. This is the default, so use --no-empty to remove them from the output. --format '%f "%v";%n' Defines the output of each config option. %t will be replaced with its individual name, %f with its full hierarchical name and %v with its value. Use uppercase letters and special characters in the value will be encoded to ensure that it can e.g. be safely used in a quoted-string as defined by RFC822. Additionally %n will be replaced by a newline, and %N by a tab. A % can be printed by using %%. -h, --help Show a short usage summary. -v, --version Show the program version. -c, --config-file Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information. -o, --option Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options. SEE ALSO
apt.conf(5) DIAGNOSTICS
apt-config returns zero on normal operation, decimal 100 on error. BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. AUTHORS
Jason Gunthorpe APT team NOTES
1. APT bug page http://bugs.debian.org/src:apt APT 1.6.3ubuntu0.1 30 November 2013 APT-CONFIG(8)
All times are GMT -4. The time now is 05:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy