in reply to Selecting Password

system qq {echo -e "$newpassword\n$newpassword" | passwd $username}

I explained the issues with running external commands like this in my node here. In this case, hippo has a good point about using existing modules, but if you absolutely must run an external command, in this case I might suggest IPC::Run3, as it allows you to avoid the shell and feed the external command some STDIN.

Replies are listed 'Best First'.
Re^2: Selecting Password
by cbtshare (Monk) on Feb 01, 2020 at 05:51 UTC
    Thank you all! I will trying using an external module