ubuntu-users at list-post.mks-mail.de
Tue Jan 19 10:45:40 UTC 2010
19.01.2010 11:16, shali Kallumpuram:
> i have script called createstaff.sh ,in that script chpasswd not working if
> i run
> echo "usename:passwd" | chpasswd
> its working,
> what is the problem??
The problem is, that in your script, you're doing something entirely
different than what you do above:
| echo $username:$password >> /root/Desktop/programming_lab/tp
| chpasswd /root/Desktop/programming_lab/tp;
The chpasswd command reads a list of user name and password pairs from
standard input, but you provide nothing as standard input to chpasswd in
| chpasswd < /root/Desktop/programming_lab/tp
BTW: what are those ';' you terminate some lines with intended to do?
You're writing a shell script, not C code.
More information about the ubuntu-users