From 0ae11d062b79c88b403a392561bc35f3075ace4c Mon Sep 17 00:00:00 2001 From: gashapwn Date: Tue, 24 Nov 2020 19:51:43 +0000 Subject: [PATCH] create-user.pl created. added globbing --- .gitignore | 1 + perl-script/create-user.pl | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 perl-script/create-user.pl diff --git a/.gitignore b/.gitignore index ae4c002..33bc05b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ venv/* test/* *~ +test_*.txt diff --git a/perl-script/create-user.pl b/perl-script/create-user.pl new file mode 100644 index 0000000..4795f24 --- /dev/null +++ b/perl-script/create-user.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +my $WORKING_DIR = "/home/gashapwn/lyadmin/"; +my $ACCOUNT_DIR = "test/"; + +my $FULL_PATH = "$WORKING_DIR$ACCOUNT_DIR"; + +my @g; + + +die "test 0"; + +@g = glob("$FULL_PATH*"); +@g = map { s/.*\/([^\/]*).pub$/$1/; $_ } grep {$_ =~ /pub$/} @g; + +for my $fn (@g){ + printf("%s\n", $fn); +} +