Last active
January 29, 2017 22:44
-
-
Save SergeyStorm/a80eb0bcbaea4dda7b8883ef2a42e89c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my $path = $ARGV[0]; | |
if ( -d $path ) { | |
if ( opendir DIR, $path ) { | |
my @dirs; | |
for my $item ( readdir DIR ) { | |
if ( -d $path.$item ) { | |
next if $item =~ m|^home|; | |
next if $item =~ m|^..$|; | |
next if $item =~ m|^.$|; | |
push @dirs, $item; | |
} | |
} | |
print $path.$_."\n" for @dirs; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment