Hi jose j cintron,

I am trying to do the same thing you explained like below, in windows
environment, but I am getting syntax error:  Do you have any idea??

perl -p -i -e 's/username\/password as SYSOPER/username\/##### as SYSOPER/g'
test.dat

Can't find string terminator "'" anywhere before EOF at -e line 1. is the
error I am getting

Jagan Rentachintala | Consultant | Idea Integration | (904) 360-2421 |
www.idea.com | (NYSE: MPS)
Idea Integration, An MPS Group Company - IT solutions from the desktop to
the data center.
________________________________

 

-----Original Message-----
From: "José J. Cintrón" [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 10:13 AM
To: Rentachintala, Jagan
Cc: beginners@perl.org
Subject: Re: Password

If your script is the one generating the log file, it should be as 
simple as to find the line that writes the password and just replace it 
with whatever string you want.  for example

old line
    print $UN."/".$PW

new line
    print $UN."/XXXXXX"

you get the idea.

If the log is being generated by some other program and you are just 
processing it, why not just make the substitution before you start 
processing something like this might do the trick

$ sed s/PASSWORD/XXXXXXXX/g <logfile.in >logfile.out
$ mv logfile.out logfile.in

Rentachintala, Jagan wrote:
> Hi,
> 
>  
> 
> I am a newbie to perl and I have a question.  In one of my project, the
perl
> script will create a logfile.  Inside the log file, the username/password
is
> in clear text. 
> 
>  
> 
> I am trying to hide the password in the logfile.  Is there a way that I
can
> hide the password or put an 'XXXXXX' in the password place in the log
file.
> 
> How do I do this.  
> 
>  
> 
> Advance thanks
> 
> Jagan Rentachintala | Consultant | Idea Integration | (904) 360-2421 |
> <http://www.idea.com/> www.idea.com | (NYSE:
> <http://www.mpsgroup.com/investors/stock/fset.asp> MPS)
> 
> Idea Integration, An MPS Group Company - IT solutions from the desktop to
> the data center.
> 
>   _____  
> 
>  
> 
> 

-- 

+------------------------------------------
| José J. Cintrón - <[EMAIL PROTECTED]>
+------------------------------------------


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to