changing unix user password using script

Hi sir,
i need help in scripting..
i have 30 users like below

eda01
eda02
eda03
eda04
.....
......
eda30

I want to reset all users password start with eda01 until eda30 to default password 1234

how do i do this using script,
i dunt want system prompt me for password..

i am using AIX 5
can anyone help me plz?
thanks in advance
regards,
Mani

are all these users on one client or multiple clients?

same client

it is very easy task, if you will use expect tool

read my topic here problem with expect eof

but i have problems with it, maybe it will work on your machine :slight_smile:

use expect script :

#!/usr/local/bin/expect

set timeout -1 
spawn passwd [lindex $argv 0]
set password 1234
expect "*password:*"
sleep 1
send "$password\r"
expect "*password again:*"
sleep 1
send "$password\r"
expect eof

call the script like :

for ((i=1; i<=30; i++)) do changepass.tcl eda$i; done

command not found for expect,i think my AIX 5.3 is not installed with expect,so any other suggestion without install it