If you use system LIST with the list having more than one element, then your command line arguments need to be separate elements, otherwise you're currently trying to run a program named literally "sudo /usr/sbin/userdel". Try my @cmd = ("sudo", "/usr/sbin/userdel", "-r", $account);.
In reply to Re: use getpwent to find users and delete them
by haukex
in thread use getpwent to find users and delete them
by garcimo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |