On 19 Sep 2002 at 18:48, Greg Schiedler wrote:
> #!/usr/bin/perl
> #
> $username=$ARGV[0];
> $password=$ARGV[1];
> $newpassword=$ARGV[2];
> #
> perl -pi -e
> 's/^($username)(\s+.*)($password)(.*)$/${1}${2}$newpassword${4}/'
> users-file.txt
You're already in perl so you don't need to call it again. Change the line
above to:
s/^($username)(\s+.*)($password)(.*)$/${1}${2}$newpassword${4}/'
You will need to read-in the user file via open and find the location of
the record you want to change before issuing that command. See 'perldoc -f
open' for details.
> And the 2nd application I want to implement is to find a given username and
> password and if found remove them from the file.
Once you figure out how to do the above, this will become more clear.
Work on some code and post a sample if you have problems.
Good luck,
William
--
Lead Developer
Knowmad Services Inc. || Internet Applications & Database Integration
http://www.knowmad.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]