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.Below is the code snippet:#!/bin/sh#Two input parameters USER_ID and PasswordDB_USER=$1DB_PWD=$2result=`sqlplus -s $DB_USER@D1TFDDS/$DB_PWD<<EOFspool sample.txtsql queryspool offEOF`v1_result=`cat sample.txt | sed -e 's/ //g' | tr   \n`echo ${v1_result} > mail.txtmailx -s Samplemail abc@gmail.com  < mail.txtIn 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 .txt file which will give me userid and password.
Help with passing parameters to a file and fetching the credentials
shell script;arguments