printing password having special characters


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers printing password having special characters
# 1  
Old 04-14-2009
printing password having special characters

Hi
I have a password stored in a file (which is a user input)
The password is having the special character $
say the password is pw$ord and is stored in the file pw_note
I am using the following statement to store the passowrd in a
variable
$schema_pwd = `cat $dir/pwd_note` ;
Now if i print the $schema_pwd
it only shows pw
It seems that it is considering $ord as variable and not printing it

Even if the user inputs pw\$ord while prompting for the password the password is stored as pw$ord and while reading with the above startement it is read as pw
can somebody please help me so that it reads as pw$ord instead of pw

Thanks in advance
Suresh
# 2  
Old 04-14-2009
Post your whole script. Then we can see what are you doing wrong.
You can try cat -v for printing special characters
# 3  
Old 04-15-2009
In csh and ksh its possible

for CSH
==========

server1% cat pass
amit$12
server1% set VAR=`cat pass`
server1% echo $VAR
amit$12

Or in ksh it will be

for KSH
==========
amit@server1 ars $ cat pass
amit$12
amit@server1 ars $ export VAR=`cat pass`
amit@server1 ars $ echo $VAR
amit$12
# 4  
Old 04-16-2009
Thanks for your replies will test and let you know
# 5  
Old 04-21-2009
Hi
For me the $ export VAR=`cat pass`
worked fine
Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. How to Post in the The UNIX and Linux Forums

How to replace value of password tag in xml with blanks when special characters are there?

Hi All, I am trying to replace the values inside <password> tag in an xml file but it doesn't replace certain passwords: For eg: Server/home/sperinc>cat TextXML.txt <appIds> <entry name="AccountXref"> <type id="ldap"> <realm>nam</realm> ... (7 Replies)
Discussion started by: saroopkris85
7 Replies

2. Shell Programming and Scripting

HOw to find special characters

I have flat file which has data like this glid¿as_liste¿025175456 How can I print these lines into new file? (4 Replies)
Discussion started by: sol_nov
4 Replies

3. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

4. Shell Programming and Scripting

special characters

Hey guys, I'm trying to replace "]Facebook" from the text but sed 's/]Facebook/Johan/g' is not working could you please help me with that? (6 Replies)
Discussion started by: Johanni
6 Replies

5. UNIX for Dummies Questions & Answers

How to see special characters?

Hi all, I was wondering how can i see the special characters like \t, \n or anything else in a file by using Nano or any other linux command like less, more etc (6 Replies)
Discussion started by: gvj
6 Replies

6. Shell Programming and Scripting

Special characters

When I open a file in vi, I see the following characters: \302\240 Can someone explain what these characters mean. Is it ASCII format? I need to trim those characters from a file. I am doing the following: tr -d '\302\240' ---------- Post updated at 08:35 PM ---------- Previous... (1 Reply)
Discussion started by: sid1982
1 Replies

7. Shell Programming and Scripting

Printing special character in bash

I am using this character as a delimiter 'þ' Currently, I set it straight: DELIMITER='þ' However, while copying the file, this character often gets mangled. Is there a bash way (perhaps using tr or printf) of generating this character. It corresponds to "chr(0xfe)" if using perl. (I've... (6 Replies)
Discussion started by: sentinel
6 Replies

8. UNIX for Advanced & Expert Users

password verification verify password of a user for only first 8 characters

Helo , I m using linux pam library for user and its password authentication. I m creating new user and giving its password.I m giving password of 10 characters.now when I login in as that newly created user its ask me $ su - ram Password: You are required to change your password immediately... (12 Replies)
Discussion started by: amitpansuria
12 Replies

9. UNIX for Dummies Questions & Answers

[OpenServer 5]Line Printing and special character (é @)

Hello, On Sco OpenServer 5, i want to print using the lpr command, no CUPS installed. I print on an HP LaserJet 4050 on LAN (IP 192.168.x.x) the printer is installed by HP Network Printer service. it works fine, but Specials characters, like é, @ or ° print bad characters. Is there... (5 Replies)
Discussion started by: tankd
5 Replies

10. UNIX for Dummies Questions & Answers

special characters

I have one file which is named ^? ( the DEL character ) I'd like to know how to rename or copy the file by using its i-node number TYIA (2 Replies)
Discussion started by: nawnaw
2 Replies
Login or Register to Ask a Question