troubleshooting Question

List Directories beginning with

Avatar of sbhegel
sbhegel asked on
Perl
5 Comments1 Solution548 ViewsLast Modified:
I am trying to get a directory listing of all directories that begin with "ui" in a specified directory.  I don't want to recurse down to any of the sub directories.  I already have a piece of code that does it but the problem is it returns the full path of the directory where as I just want the directory name.  

CODE:

$DIR="/reg00/app/Tomcat/tomcat6-ui25/webapps";
@ENV = <$DIR/ui*>;

 foreach $env (@ENV) {
   print "$env <br>";
 }


RESULTS:
/reg00/app/Tomcat/tomcat6-ui25/webapps/uicrp01_25
/reg00/app/Tomcat/tomcat6-ui25/webapps/uicrp03_25
/reg00/app/Tomcat/tomcat6-ui25/webapps/uiedi01_25


Instead of the full path of /reg00/app/Tomcat/tomcat6-ui25/webapps/uicrp01_25, I just want uicrp01_25.

Thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros