in reply to Re^3: Linux::usermod - user name ... already exists
in thread Linux::usermod - user name ... already exists
It looks like this is the distilled version of what I will try. The validation of the two variables takes place earlier in another function.
$ENV{'PATH'}=q(/sbin:/bin:/usr/sbin:/usr/bin); my ($um,$gm); qx/usermod --login $newname --home $newname $oldname/; $um = $?; if ($um==0) { qx/groupmod --new-name $newname $oldname/; $gm = $?; }
Ideas or corrections?
No output is produced, so I don't try to capture any. And the home directory gets reassigned and renamed elsewhere, too, since I have a little non-standard home directory arrangement for those groups.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Linux::usermod - user name ... already exists
by haukex (Archbishop) on Mar 21, 2019 at 13:42 UTC | |
by mldvx4 (Hermit) on Mar 22, 2019 at 11:59 UTC | |
by haukex (Archbishop) on Mar 25, 2019 at 09:55 UTC | |
|
Re^5: Linux::usermod - user name ... already exists
by choroba (Cardinal) on Mar 20, 2019 at 15:06 UTC |