Emilio Casbas 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?
$ perl -le' use File::Basename; my $path = q[/usr/local/etc5/test]; print join q[/], dirname( $path ), uc basename( $path ); ' /usr/local/etc5/TEST John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
