djuncews Absent Member.
Absent Member.
414 views

Is there a way to prevent the output of a command from being displayed in the log?

Jump to solution

I have sql script created using ksc_begin_script that connects to one Database grabs some data and then uses it to connect to another db.  When I worked for another company this script worked fine, but in this installation the following command in the script fails because the password is in encrypted.

 

connect [DEST_ENV.ENV.DB_USERNAME]/[DEST_ENV.ENV.DB_PASSWORD]@[DEST_ENV.DB_CONNECT_STRING]

translates to 

 

connect apps/#!#33tf WGXA}g7Sx1oz~3mYKt_~prjf1}acgQBhEKOx{wUX/$Tfz{9Y)roD5dIK::~W$eB(g.NY@H_Q-KO2ue}ba.e2&tnT<,64FDr^u*`iqAgrb)5RCsD^5G9.5KoqpYnsAAJpNstN^4/~&L|HC6.x7$iV>|RfrrOZ3c$M}:9)3O/7Z+7X{svKgIOEW~RI#!#@EBSDEV3

I found if I use the following when connected to  a server the password is not encrypted in the variable (which is good).

ksc_set V_PW="[DEST_ENV.ENV.DB_PASSWORD]"

 

Unfortunately when the command is executed it displays the password in the log file.

 

KSC Set

Source Command:Generate the Script File

V_PW=ABDC12345
Succeeded

 

I tried using 

ksc_set V_PW="[DEST_ENV.ENV.DB_PASSWORD]" >>/dev/nell and it fails with a paring error.

 

Does anybody know how to prevent this from being displayed inthe output file or prevent passwords that are passed into the KSC_BEGIN_SCRIPT from being encrypted?

 

Thanks for you help.

 

Dan

0 Likes
1 Solution

Accepted Solutions
djuncews Absent Member.
Absent Member.

Re: Is there a way to prevent the output of a command from being displayed in the log?

Jump to solution

I am connecting to two different databases.  One to start the script and one in the middle of the script.

 

I was able to get it to work using the driver=filename.sql.

 

I used echos and echoed the password into the file and it worked.  I did have to escape the special characters like quotes to appeara ppropriately.

 

Thank you for your help.

 

 

 

 

0 Likes
3 Replies
Established Member.. Utkarsh_Mishra
Established Member..

Re: Is there a way to prevent the output of a command from being displayed in the log?

Jump to solution

There is hide option in ksc_simple_respond. You can use it is it fits in your requirement.

 

 

ksc_simple_respond "command" -hide "prompt 1" "response 1"["prompt 2" "response 2" … ]

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
0 Likes
Absent Member.. Mohit_Agrawal Absent Member..
Absent Member..

Re: Is there a way to prevent the output of a command from being displayed in the log?

Jump to solution

Hi..

 

You can use KSC_SIMPLE_RESPOND as suggested above.

 

But we are not using that. What we do is:

 

##########

ksc_connect_dest_server
cd ./[P.P_SUB_PATH]

 

envfile=`echo .profile.[DEST_ENV.DB_ORACLE_SID] | tr '[A-Z]' '[a-z]'`
. /home/[DEST_ENV.ENV.SERVER_USERNAME]/$envfile

 

driver=driver_[PKG.ID]_[PKGL.SEQ].sql

 

sqlplus [DEST_ENV.APP="Oracle Database".DB_USERNAME]/[DEST_ENV.APP="Oracle Database".DB_PASSWORD]@[DEST_ENV.DB_CONNECT_STRING] @$driver

 

##########

 

And it works without shwoing the password for any DB user.

 

Regards,

Mohit

0 Likes
djuncews Absent Member.
Absent Member.

Re: Is there a way to prevent the output of a command from being displayed in the log?

Jump to solution

I am connecting to two different databases.  One to start the script and one in the middle of the script.

 

I was able to get it to work using the driver=filename.sql.

 

I used echos and echoed the password into the file and it worked.  I did have to escape the special characters like quotes to appeara ppropriately.

 

Thank you for your help.

 

 

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.