in reply to Re: Linux::usermod - user name ... already exists
in thread Linux::usermod - user name ... already exists

my $username = `usermod -l $nname $name`; my $dirusername = `usermod -d /home/$nname -m $nname`;

I would recommend against this way of doing this because it allows for injection of arbitrary shell commands via $nname and $name, and it does not check for errors in the commands. See also.

Replies are listed 'Best First'.
Re^3: Linux::usermod - user name ... already exists
by thanos1983 (Parson) on Mar 21, 2019 at 18:58 UTC

    Hello haukex,

    I read your post so I guess something like that should be better :).

    Update: Adding minor conversion STDOUT to array for better data manipulation.

    Thank you for the information. BR / Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!

      Yes, that does look better to me, thanks!