Masking Content of a String


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Masking Content of a String
# 1  
Old 07-01-2008
Masking Content of a String

Hello,

I need to know that whether a content of a string can be hidden or masked inside a shell script.

My Sample Code is given below

<Code>
#!/usr/bin/ksh
Userid=test
DB=temp
Passwd=`java Decryption test`
# The Above command will get the encryped password for "test" user id and store it in Passwd Variable.
# I donot want anybody to see the Value of Passwd even if it is echoed on the screen. (ie) Either by masking or hiding.
# I want to connect to a DB by passing the Passwd Vairable
CONN=`sqlplus -s $Userid/$Passwd@DB <<EOF
whenever sqlerror exit failure
select * from dual;
EOF`
echo "CONN : "$CONN
</Code>

Can anybody help me on this.

Thanks

Rahul

Last edited by maxmave; 07-01-2008 at 05:08 PM.. Reason: Subject
# 2  
Old 07-01-2008
This question has been answered many times in many forums. Suggest you do a Web search for "oracle hide username password"
# 3  
Old 07-01-2008
Code:
/oracle/app/oracle/product/9.2.0.1/bin/sqlplus -S /nolog <<END_SQL
connect $LOGON
(Rest of SQL)
exit
END_SQL

Pattern after this, we had the same problem.

Do the connect within the SQL - in our case LOGON contains the login information - then run the rest of the sql.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issues Masking(Encrypting) a string

Hi, echo "mypassword" | crypt "tom" But this is giving me some unreadable strange looking characters / symbols never seen before which I cant even copy and save in a file. SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v Can you help me with encrypting the password "mypassword" in... (15 Replies)
Discussion started by: mohtashims
15 Replies

2. Shell Programming and Scripting

korn shell: check the content of a string of a variable

hello, i have a variable which should have following content : var="value1" or var="value2" or var="value2:*" # example: value2:22 how can i check : - if the content is ok (value1 / value2* ) - the two options of "value2" when content is example "value2:22" , i want to split... (3 Replies)
Discussion started by: bora99
3 Replies

3. Shell Programming and Scripting

Replace string by file content

hi I have template file my.tpl: bla-bla-bla <link href="style.css" type="text/css"> bla-bla-bla and style.css : body{margin: 0px;} I want to get in result one file: bla-bla-bla <script>body{margin: 0px;}</script> bla-bla-bla I tryed to used SED: sed '/<link .*href=\"(*)*\"... (6 Replies)
Discussion started by: dim_nsk
6 Replies

4. Shell Programming and Scripting

Query for replacing a string and keeping the non-replaced content

Hi experts, As i am a novice unix player...so need help for the below query...banged my head from quite a while...:confused: i have a set of html files, in which i need to search for string "Page"(case sensitive) and then replace the same with some numeric code ,say, "XXX1234". Here in... (2 Replies)
Discussion started by: rahulfhp
2 Replies

5. Shell Programming and Scripting

how to add string inside the file's content

Hi, How to add string inside the file. In this case adding 63 in the beginning of each line. Thnks. e.g. what is inside the file Mobile Number Portability 9051151234 9051261345 9051393245 9051412345 9051507654 should like this as output: Mobile Number Portability (7 Replies)
Discussion started by: shtobias
7 Replies

6. Shell Programming and Scripting

Search for string in filename, not file content

How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test". (3 Replies)
Discussion started by: daflore
3 Replies

7. UNIX for Dummies Questions & Answers

Help to extract the content in this string

Hi All, I have a string in the following format: "kf skjgsdjgngnsd sdgsd ksjgbksjgb kjsbgsjdgb dfhdh sjgsjg j jsbekgjsbdkgj". In this format i want to extract the contents which is in between the two empty lines:... (6 Replies)
Discussion started by: bala041
6 Replies

8. Shell Programming and Scripting

shell script to search a string and delete the content

Hi, I've a shell script e.g. #!/bin/bash echo "Enter the next hop id" read nhid echo "enter the IP address" read IP echo "enter the interface name" read name echo "enter the enable/disable state" read state exit 0 now from this script i want to search strings in another (.cam) ... (6 Replies)
Discussion started by: vic_mnnit
6 Replies

9. Shell Programming and Scripting

replace a string with content from another file

Hi, I'm a newbi in shell script. Here what I want to do: FileA: bor bor bor xxxx bib bib bi FileB: something something something I want to replace string "xxxx" in FileA with contents of FileB. i tried with sed: fileb=`cat FileB` reg=xxxx file=FileA (4 Replies)
Discussion started by: afatguy
4 Replies

10. UNIX for Dummies Questions & Answers

Compare the content of a variable with a string

Hello all: I'm new in Unix and here and I'am spanish so my english isn't so good to explain my doubt. Here it is. Very urgent: I need to compare the value of a variable with a string. Example is this. Imagine that the variable x1 contains the path and a file text and I need to compare... (2 Replies)
Discussion started by: robdai
2 Replies
Login or Register to Ask a Question