From ce70c062c6e2b796456cd548f2f1254b82b54d3b Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 7 Jul 2020 20:04:31 +0200 Subject: Good start --- update-gitjoe.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/update-gitjoe.pl b/update-gitjoe.pl index b79f9aa..a4eccdd 100755 --- a/update-gitjoe.pl +++ b/update-gitjoe.pl @@ -5,6 +5,22 @@ use warnings; use Term::ANSIColor; sub main { + my $homedir = '/usr/home/'; + my @users; + opendir(DIR, $homedir); + my $i = 0; + while (my $dir = readdir(DIR)) { + next if ($dir eq 'git-ro'); + next if ($dir =~ m/^\./); + $users[$i] = $dir; + $i += 1; + } + closedir(DIR); + $i = 0; + while ($i < @users) { + print $users[$i] . "\n"; + $i += 1; + } exit; } -- cgit v1.2.3