in reply to •Re: Re: Create a list of directories without . and ..
in thread Create a list of directories without . and ..

Watch it. That falsely excludes ..foo and .bar. Oops! Maybe you want ...

Ewps. Typo on my part. I meant

-d $_ and ! /^\.\.?$/ ^
though \z would be safer than $.

Replies are listed 'Best First'.
Re: Re: •Re: Re: Create a list of directories without . and ..
by Juerd (Abbot) on Jun 04, 2002 at 22:36 UTC

    -d $_ and ! /^\.\.?$/

    No, you meant \z instead of $. $ matches _before_ \n (if there is any). Newline is a valid character in filenames with many filesystems.

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.