use strict; use warnings; `groupadd quotagroup`; my @user_s=map{"user".$_}(1..5); for(@user_s){ `userdel $_`; } for(@user_s){ eval{ `useradd -G quotagroup $_` && `echo "password"| passwd --stdin $_`; } }