Sponsored Content
Top Forums Shell Programming and Scripting Help with passing parameters from a file Post 302943162 by karthik adiga on Wednesday 6th of May 2015 01:07:54 AM
Old 05-06-2015
Thanks for the reply...here is the snippet
Code:
#!/bin/sh
#Two input parameters USER_ID and Password
DB_USER=$1
DB_PWD=$2
result=`sqlplus -s $DB_USER@D1TFDDS/$DB_PWD<<EOF
spool sample.txt
sql query
spool off
EOF`
v1_result=`cat sample.txt | sed -e 's/ //g' | tr " " "\n"`
echo "${v1_result}" > mail.txt
mailx -s "Samplemail" abc@gmail.com  < mail.txt

In here am passing id and password as parameter to fetch the result.I do not want to pass my credentials to the script,instead can i store it in a .txt file with restricted permission.

And pass say environment id and schema name as parameter to the .txtfile which will give me userid and password
 

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
mbot.conf(5)							File Formats Manual						      mbot.conf(5)

NAME
mbot.conf -- mbot configuration file SYNOPSIS
mbot.conf Description mbot.conf is organized in sections where you can associate handlers to mails. When mbot receive a mail, it will search for a section having a name which match the mail subject, then use the associated handler. So the name of the section will depend on the subject to use, and the parameters to be defined in this section will depend on the selected han- dler. Here is a list of available handlers: GoogleHandler Used to perform some search with the well known search engine UrlHandler This one allows to download some url and attach its content to the return mail, with the mime type properly set. NewsHandler You can also send some news (with images) to mbot, it will fill your database with it. Currently supported RDBMs are PostgreSQL and MySQL, so you will have to choose between PgNewsHandler and MyNewsHandler. PipeHandler This one will make mbot call an arbitrary given command! Default and common options For each section we have a common option who's: HANDLER This option define for the current section which Handler will be used. WHITE_LIST Here we define which are the e-mail addresses allowed to use associated Handler. Only e-mails are stored here, like this: name@domain.tld. If no BLACKLIST is defined then the sender MUST be in this list otherwise mail will be rejected BLACK_LIST This list contains blocked emails. If sender is in this list, mbot won't be allowed to handle the request. If BLACK_LIST exists but not WHITE_LIST then every sender who's not in this list will be allowed to use this Handler. The format of the list is: ["email@domain.tld", "email2@anotherdom.tld"]. It's the same as WHITE_LIST. Default options: MBOT_ADDRESS Email address used in the response. LOG_LEVEL Here we tell the Logger which level we want to log to syslog. Those levels are, from lower to higher, emerg - alert - crit - err - warning - notice - info - debug. Handler's options GoogleHandler's options: HOST This is the first for this Handler, it define the host for the searching engine. BASE_URL Define here the string that is usually used by the searching engine. UrlHandler's options: MAILSIZE This option define the maximum mail size while mbot fetch url, sender will receive error message if mail size exceed this value. ATTSIZE For each attachement we define a size behind which mbot will raise an error. NewsHandler's options: HOST This is the FQDN for the database server. DB The name of the database. DB_USER Username to add entry into database. NEWS_TBL Name of the table used by the Handler. NEWS_TBLSQ Name of the sequence table used by the Handler. Usually used with Postgres server's. ATTACH_PATH Used if sender attach an image with his mail, in this directory mbot will resize image to store it as normal and thumb- nail size into database. tnX and tnY These are the options for thumbnail resizing. SITE This is a list in which mbot will select the site according to the receiver email. It will be used to feed the data- base. PHOTO_TBL This option is optionnal, it will be used only if you want to have pictures associated to news. PHOTO_TBLSQ Name of the sequence table used by the Handler for the photo table. Usually used with Postgres server's. Note that there is no option for PipeHandler. Bugs Please report bugs to the authors. See Also mbot(1) Authors mbot was writen by Dimitri Fontaine dim@tuxfamily.org and Christophe Truffier nah-ko@tuxfamily.org. mbot.conf(5)
All times are GMT -4. The time now is 02:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy