Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Load config file at commandline Post 302927212 by babyPen1985 on Monday 1st of December 2014 02:49:02 PM
Old 12-01-2014
Load config file at commandline

Hello,

This would be very basic question to most of you, but for me as a newbie it is an un-know.

I would like to load a configuration file into memory before executing a specific command. For example: I have a config file that holds all the database connectivity information and I'd like to load this specific db config file in order to execute a command:
config file will have:
Code:
export user=xyz
export password=abc
export database=123

Code:
mysql -u $user -password $password -db $database

I need the values correctly read from the config file that I will load before executing the above command.
Help is much appreciated.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

trying to strip the first 4 char. of a file out via commandline

im kind alost. i beleave its a sed command. but i cant seem to find it in my book. can someone point me in the write direction. i know this is extreamly sloppy. but this is what i did untill i can figure out how to manipulate the filename namespace. an ls on the directory where this would run... (2 Replies)
Discussion started by: Optimus_P
2 Replies

2. Shell Programming and Scripting

Need help in wrting Load Script for a Load-Resume type of load.

hi all need your help. I am wrting a script that will load data into the table. then on another load will append the data into the existing table. Regards Ankit (1 Reply)
Discussion started by: ankitgupta
1 Replies

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

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

5. Shell Programming and Scripting

How to print and append output of nawk script in commandline and as well into a file?

Hi All, I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file. Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file. script :... (3 Replies)
Discussion started by: Optimus81
3 Replies

6. Red Hat

Apache virtual host config vs global config problem

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

7. UNIX for Dummies Questions & Answers

VPS has load 200, httpd load no activity, netstat nothing

Hello, on my hostserver i see one VPS of mine got load of 200.00 and netstat nothing (not a single blank line on netstat command) after some time, netstat started showing connections, but i see no excessive IP connections. tail -f /var/log/httpd/access_log shows no activity /var/log/messages ;... (1 Reply)
Discussion started by: postcd
1 Replies

8. Shell Programming and Scripting

How to add a line in every file with perl commandline?

Hi, i want to add a line at the beginning of every file in a directory. perl -i.bkp -p -e 'print "#include /verif/pdd1/exu/sxs/6sTest/reset/dfu/top_level.reset\n" if $. == 1' *.reset But this command is updating only the first file in the directory. I think this is because $. is not resetting... (3 Replies)
Discussion started by: twistedpair
3 Replies
UI(1)							    BSD General Commands Manual 						     UI(1)

NAME
ui -- show information about local users SYNOPSIS
ui [-hvVL] [-F separator] [-m separator] [-t format] [-d] [[-xXO] module1.so [options] [-- [-xXO] module2.so [options] [...]]] [-c filename] [user] | [-f filename] [...] DESCRIPTION
ui uses loadable modules to display various information about a local user. Multiple usernames or filenames (see -f) may be specified. If no arguments are given or a username or filename is '-', then arguments are read via standard input. -d Load the default modules (passwd.so, mail.so and login.so). This can be used anywhere in the module list. -t format Specify an alternate time format for modules which have time values. See the strftime(3) manual page for format syntax. -c filename Load a configuration file. May be used more than once. See below for details. -O filename Load a module. The remaining switches are to be options for this module. End options for this module by specifying --. This option may by used more than once. Due to the way module chaining is implemented, the same module may be loaded more than once. -x filename Like -O but chain module1.so output to module2.so input. This will only work if the module is chainable. You can specify this option more than once for unlimited chaining. -X filename The same as -x but don't output module1.so info, only pass the strings to module2.so for processing. -F separator Alternate character used to separate fields. Standard escape sequences are supported. -m separator Alternate character used to separate multi string values. Standard escape sequences are supported. -f Get information for the owners of the specified files. -L If the -f option is specified and the file is a symbolic link, get owner information for the file the link points to and not the link itself. -v Be verbose when possible. Some modules may limit their display. This should show everything available. This is reset for each loaded mod- ule unless specified twice. -h Display help text. A module must be specified either with the -O command line option or loaded via configuration file -c for a modules help text to be displayed. -V Version information. RETURN VALUES
Returns 1 on failure and 0 on success. Note that a modules return value affects this exit status. FILES
PREFIX/lib/userinfo Default location of loadable modules. EXAMPLES
The following will load two modules, specify module options and load a configuration file. Module options end when -- is reached. ui -O module.so -switches -- -O another.so -- -c filename `users` SEE ALSO
strftime(3), passwd(5), aliases(5), forward(5), utmp(5), lastlog(5), ld.so(8) dlopen(3) CONFIGURATION FILE SYNTAX
There is no default configuration file that will be loaded so you'll have to create one and load it with the -c command-line option. Empty lines and everything to the right of a '#' are ignored. If you need a '#' in your options, escape it with a ''. This file should contain any modules you want loaded and their options separated by one or more whitespace characters on one line per module. Each module should have a .so filename extension. If a module filename begins with a ~, it will be expanded to your home directory. Some mod- ule options may require quoting. Single and double quotes are supported and may also be escaped with a backslash character. Multiple config- uration files may be specified and may also be used with the -O command-line option. The order of module loading and output is dependent on the order of the module stack and any module options. If you want module chaining, put a '>' or '-' at the beginning of the module name before any '~'. This is the same as specifying -x or -X on the command line, respectively. The following module, which may also be chained, will be chained to this module. AUTHORS
Ben Kibbey <bjk@luxsci.net> BSD
December 05, 2004 BSD
All times are GMT -4. The time now is 03:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy