hi i am trying to do this as mentioned in the answer using perl but it's not working.
#!/usr/bin/perl -w
$pipe="data";
$username="mukesh";
$password="mukesh";
open my $pipe, '|chpasswd' or die "can't open pipe: $!";
print {$pipe} "$username:$password";
close $pipe
[root@testgfs2 user_mgmt]# ./tess3.sh
Name "main::pipe" used only once: possible typo at ./tess3.sh line 2.
chpasswd: line 1: line too long
chpasswd: error detected, changes ignored
can any body suggest.whats wrong.
since --stdin is not avalable on all *nix i am trying to use this
EDIT : Is there any program in C to do this.cause that maigh be usefull for all versision if *nixes