my @split_line = split(/\:/, $line);
my $home = $split_line[5];
my @split_home = split(/\/, $home);
return uc($split_home[scalar(@split_home) - 1]);

On 1/11/07, Emilio Casbas <[EMAIL PROTECTED]> wrote:
I know that this is not a exact perl question, but maybe someone has a
perl solution.

You have the passwd file such this:

--------------------------------------------
test:x:593:501::/usr/local/etc5/test:/bin/bash
--------------------------------------------

and you have to convert it to:

--------------------------------------------
test:x:593:501::/usr/local/etc5/TEST:/bin/bash
--------------------------------------------

Only converting to capital letter the last part of the home directory.
Anyone have some way to achieve it?

Regards.
Emilio C.

--




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




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


Reply via email to