Skip to content

Instantly share code, notes, and snippets.

@SergeyStorm
Last active January 29, 2017 22:44
Show Gist options
  • Save SergeyStorm/a80eb0bcbaea4dda7b8883ef2a42e89c to your computer and use it in GitHub Desktop.
Save SergeyStorm/a80eb0bcbaea4dda7b8883ef2a42e89c to your computer and use it in GitHub Desktop.
#!/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