Sponsored Content
Top Forums Shell Programming and Scripting Help with passing parameters from a file Post 302943087 by karthik adiga on Tuesday 5th of May 2015 09:42:19 AM
Old 05-05-2015
Help with passing parameters from a file

Hello Everyone,


I have developed a shell script which takes schema id and password as parameter to login into database using sqlplus,runs a query and mails the result.


My requirement is that, I dont want to pass userid and password as parameters.Instead,I want to pass say Environment name and Schema name as parameters to the script and userid and password will be stored in a txt file.

Now,Is it posssible to pass Environment name and Schema name to the txt file fom the script and get the userid and passowrd from there ?


Thanks in advance.
 

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
Catalyst::Helper::Model::DBIC::Schema(3pm)		User Contributed Perl Documentation		Catalyst::Helper::Model::DBIC::Schema(3pm)

NAME
Catalyst::Helper::Model::DBIC::Schema - Helper for DBIC Schema Models SYNOPSIS
script/create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass [ create=dynamic | create=static ] [ traits=trait1,trait2... ] [ Schema::Loader opts ] [ dsn user pass ] [ other connect_info args ] DESCRIPTION
Helper for the DBIC Schema Models. Arguments: "CatalystModelName" is the short name for the Catalyst Model class being generated (i.e. callable with "$c->model('CatalystModelName')"). "MyApp::SchemaClass" is the fully qualified classname of your Schema, which might or might not yet exist. Note that you should have a good reason to create this under a new global namespace, otherwise use an existing top level namespace for your schema class. "create=dynamic" instructs this Helper to generate the named Schema class for you, basing it on DBIx::Class::Schema::Loader (which means the table information will always be dynamically loaded at runtime from the database). "create=static" instructs this Helper to generate the named Schema class for you, using DBIx::Class::Schema::Loader in "one shot" mode to create a standard, manually-defined DBIx::Class::Schema setup, based on what the Loader sees in your database at this moment. A Schema/Model pair generated this way will not require DBIx::Class::Schema::Loader at runtime, and will not automatically adapt itself to changes in your database structure. You can edit the generated classes by hand to refine them. "traits" is the list of traits to apply to the model, see Catalyst::Model::DBIC::Schema for details. "Schema::Loader opts" are documented in DBIx::Class::Schema::Loader::Base and some examples are given in "TYPICAL EXAMPLES" below. "connect_info" arguments are the same as what "connect" in DBIx::Class::Schema expects, and are storage_type-specific. They are documented in "connect_info" in DBIx::Class::Storage::DBI. For DBI-based storage, these arguments are the dsn, username, password, and connect options, respectively. These are optional for existing Schemas, but required if you use either of the "create=" options. username and password can be omitted for "SQLite" dsns. Use of either of the "create=" options requires DBIx::Class::Schema::Loader. TYPICAL EXAMPLES
Use DBIx::Class::Schema::Loader to create a static DBIx::Class::Schema, and a Model which references it: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static dbi:mysql:foodb myuname mypass Same, with extra connect_info args user and pass can be omitted for sqlite, since they are always empty script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static dbi:SQLite:foo.db AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached on_connect_do='["select 1", "select 2"]' quote_names=1 ON WINDOWS COMMAND LINES QUOTING RULES ARE DIFFERENT In "cmd.exe" the above example would be: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static dbi:SQLite:foo.db AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached on_connect_do="["select 1", "select 2"]" quote_names=1 Same, but with extra Schema::Loader args (separate multiple values by commas): script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static db_schema=foodb components=Foo,Bar exclude='^(wibble|wobble)$' moniker_map='{ foo => "FOO" }' dbi:Pg:dbname=foodb myuname mypass Coderefs are also supported: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static inflect_singular='sub { $_[0] =~ /A(.+?)(_id)?z/; $1 }' moniker_map='sub { join(q{}, map ucfirst, split(/[W_]+/, lc $_[0])); }' dbi:mysql:foodb myuname mypass See DBIx::Class::Schema::Loader::Base for a list of options Create a dynamic DBIx::Class::Schema::Loader-based Schema, and a Model which references it (DEPRECATED): script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=dynamic dbi:mysql:foodb myuname mypass Reference an existing Schema of any kind, and provide some connection information for ->config: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass dbi:mysql:foodb myuname mypass Same, but don't supply connect information yet (you'll need to do this in your app config, or [not recommended] in the schema itself). script/myapp_create.pl model ModelName DBIC::Schema My::SchemaClass METHODS
mk_compclass This is called by Catalyst::Helper with the commandline args to generate the files. run Can be called on an instance to generate the files. SEE ALSO
General Catalyst Stuff: Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response, Catalyst::Helper, Catalyst, Stuff related to DBIC and this Model style: DBIx::Class, DBIx::Class::Schema, DBIx::Class::Schema::Loader, Catalyst::Model::DBIC::Schema AUTHOR
See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in Catalyst::Model::DBIC::Schema. COPYRIGHT
See "COPYRIGHT" in Catalyst::Model::DBIC::Schema. LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-12 Catalyst::Helper::Model::DBIC::Schema(3pm)
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy