SPUG: getting a list of directories

EXT-Litwin, Keith Keith.Litwin at pss.boeing.com
Thu Jan 20 15:06:36 CST 2000


How about the sloppy unix way

@dirs=`file *|grep directory|cut -d":" -f1`;

Not sure if this is portable across unicies and it will give you all directories from your current downward.

Keith.

> ----------
> From: 	Todd Wells[SMTP:toddw at wrq.com]
> Sent: 	Thursday, January 20, 2000 11:53
> To: 	'spug-list at pm.org'
> Subject: 	SPUG: getting a list of directories
> 
> I'd like to get a list of directory names (and only directory names) in
> /usr/myapp.  What's the best way to go about this?  I wish the cookbook had
> a recipe for this.  I see that readdir specifically excludes directory
> names.
> 
> -Todd
> 
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>     POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
>  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
>  SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
>         Email to majordomo at pm.org: ACTION spug-list your_address
> 
> 

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list