Sponsored Content
Top Forums Shell Programming and Scripting Help with passing parameters from a file Post 302943088 by rbatte1 on Tuesday 5th of May 2015 09:48:56 AM
Old 05-05-2015
Is the database local? Can you convert the account to allow sqlplus /

If it's Oracle, then I think it's something like:-
Code:
alter user bob identified externally ;

This would negate having to know/store the password anywhere. If you can validate to log on to the operating system, then you are trusted to the database.

Failing that, what have you tried? Storing details like this are notoriously fraught with danger from someone else being able to read the files. If they can read the script (to run it) then they can find the file.


Can you give us more context as to what the eventual end requirement is?



Robin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Passing parameters in script

I have 2 scripts: script1 and script2 Script1 passes 4 parameters to script2 as follows #script1 code ... ... script2 $var1 $var2 $var3 $var4 Script2 uses the export command to know to expect these values #script2 export $1 $2 $3 $4 code ... ... The problem that I am having is... (1 Reply)
Discussion started by: eliguy
1 Replies

2. Shell Programming and Scripting

Passing parameters through a file

I have created a script "myscript.sh" I need to run this script with diffrent parameters. The parameters are stored in a file myparam.txt. I need to run myscript.sh script for every parameter supplied in myparam.txt. Example: If myparam.txt contains following lines: param1 param2 param3... (3 Replies)
Discussion started by: chawlaaman
3 Replies

3. Shell Programming and Scripting

passing more than 9 parameters

hi, i am passing around 14 parameters for a script a=$1 b=$2 c=$3 d=$4 e=$5 f=$6 g=$7 h=$8 i=\"${9}\" shift j=\"${1}\" still for j it is displaying the 1st parameter value..how to make it take the 10th parameter (2 Replies)
Discussion started by: dnat
2 Replies

4. Shell Programming and Scripting

passing parameters using awk

Hi, The below script is working fine awk1.sh ======= awk BEGIN { FS="|" } FNR==NR { f1=$2; next } $1 in f1 && $2 =="xx" && $1 == "DAILY_JOB" {print $3} awk -f awk1.sh a.txt b.txt--Its working fine . When passing parameters its not working .Any help it should be appereciated. ... (4 Replies)
Discussion started by: akil
4 Replies

5. Shell Programming and Scripting

Passing the parameters using a function

Hi All, I am new to shell scripting required some help in passing the parameter value to the shell script. I am writing a shell script, in the script I have created two functions as below. first function get_trend_ids () { Here I am connecting to the database and getting all the... (3 Replies)
Discussion started by: shruthidwh
3 Replies

6. UNIX for Dummies Questions & Answers

Passing the parameters through a file

Hi All, I have written a shell script and the script is working fine, I am passing my MIT_ID(NUMBER VALUE) to the shell script from the command prompt and my script is executing as expected. Now I have to pass all the MIT_ID's from a .txt file to the shell script,as I am automating this I... (6 Replies)
Discussion started by: gaur.deepti
6 Replies

7. Shell Programming and Scripting

passing parameters to the script

how can i make a script to run only when parameters are given, if parameters are not given it should through an error , saying "please enter a parameter" for ex: i want a find command to run only when the parameters are given (4 Replies)
Discussion started by: knip
4 Replies

8. Shell Programming and Scripting

passing parameters with spaces

we are using following script to execute stored procedue. The problem is run_pmcmd.ksh script is using $* parameter which is not taking in account 'Men Shirt' parameter which includes spaces. 1. Step 1 run_pmcmd.ksh CONVERT_TEST script for run_pmcmd.ksh /u01/$(whoami)/run_pmcmd.ksh... (11 Replies)
Discussion started by: sandy162
11 Replies

9. Shell Programming and Scripting

Passing 2+ parameters to one command

I have a script that uses more than one parameter. It looks like this: for i in `cat /tmp/listofpolicies`; do for x in $(cat /tmp/lst |sed 's/^/\/usr\/openv\/netbackup\/db\/class\//g'); do /usr/openv/netbackup/bin/admincmd/bpplinclude $i -delete -f $x;done;done The problem is that the... (3 Replies)
Discussion started by: newbie2010
3 Replies

10. Shell Programming and Scripting

Passing Parameters to Crontab

Hello Experts, I have a requirement to pass some parameters to Linux cron tab. For ex: My default cron entry looks like this as below: ------------------------------- 55 10 * * --... (7 Replies)
Discussion started by: MaheshChaudhari
7 Replies
INITDB(1)						  PostgreSQL Server Applications						 INITDB(1)

NAME
initdb - create a new PostgreSQL database cluster SYNOPSIS
initdb [ option... ] [ --pgdata ] [ -D ] directory DESCRIPTION
initdb creates a new PostgreSQL database cluster. A database cluster is a collection of databases that are managed by a single server instance. Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases. When you later create a new database, everything in the template1 database is copied. (Therefore, anything installed in template1 is automati- cally copied into each database created later.) The postgres database is a default database meant for use by users, utilities and third party applications. Although initdb will attempt to create the specified data directory, it might not have permission if the parent directory of the desired data directory is root-owned. To initialize in such a setup, create an empty data directory as root, then use chown to assign ownership of that directory to the database user account, then su to become the database user to run initdb. initdb must be run as the user that will own the server process, because the server needs to have access to the files and directories that initdb creates. Since the server cannot be run as root, you must not run initdb as root either. (It will in fact refuse to do so.) initdb initializes the database cluster's default locale and character set encoding. The character set encoding, collation order (LC_COL- LATE) and character set classes (LC_CTYPE, e.g. upper, lower, digit) can be set separately for a database when it is created. initdb deter- mines those settings for the template1 database, which will serve as the default for all other databases. To alter the default collation order or character set classes, use the --lc-collate and --lc-ctype options. Collation orders other than C or POSIX also have a performance penalty. For these reasons it is important to choose the right locale when running initdb. The remaining locale categories can be changed later when the server is started. You can also use --locale to set the default for all locale categories, including collation order and character set classes. All server locale values (lc_*) can be displayed via SHOW ALL. More details can be found in in the documentation. To alter the default encoding, use the --encoding. More details can be found in in the documentation. OPTIONS
-A authmethod --auth=authmethod This option specifies the authentication method for local users used in pg_hba.conf. Do not use trust unless you trust all local users on your system. Trust is the default for ease of installation. -D directory --pgdata=directory This option specifies the directory where the database cluster should be stored. This is the only information required by initdb, but you can avoid writing it by setting the PGDATA environment variable, which can be convenient since the database server (post- gres) can find the database directory later by the same variable. -E encoding --encoding=encoding Selects the encoding of the template database. This will also be the default encoding of any database you create later, unless you override it there. The default is derived from the locale, or SQL_ASCII if that does not work. The character sets supported by the PostgreSQL server are described in in the documentation. --locale=locale Sets the default locale for the database cluster. If this option is not specified, the locale is inherited from the environment that initdb runs in. Locale support is described in in the documentation. --lc-collate=locale --lc-ctype=locale --lc-messages=locale --lc-monetary=locale --lc-numeric=locale --lc-time=locale Like --locale, but only sets the locale in the specified category. -X directory --xlogdir=directory This option specifies the directory where the transaction log should be stored. -U username --username=username Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different. -W --pwprompt Makes initdb prompt for a password to give the database superuser. If you don't plan on using password authentication, this is not important. Otherwise you won't be able to use password authentication until you have a password set up. --pwfile=filename Makes initdb read the database superuser's password from a file. The first line of the file is taken as the password. Other, less commonly used, parameters are also available: -d --debug Print debugging output from the bootstrap backend and a few other messages of lesser interest for the general public. The bootstrap backend is the program initdb uses to create the catalog tables. This option generates a tremendous amount of extremely boring out- put. -L directory Specifies where initdb should find its input files to initialize the database cluster. This is normally not necessary. You will be told if you need to specify their location explicitly. -n --noclean By default, when initdb determines that an error prevented it from completely creating the database cluster, it removes any files it might have created before discovering that it cannot finish the job. This option inhibits tidying-up and is thus useful for debug- ging. ENVIRONMENT
PGDATA Specifies the directory where the database cluster is to be stored; can be overridden using the -D option. This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see in the documentation). SEE ALSO
postgres(1) Application 2010-05-14 INITDB(1)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy