What are 'expect' and 'send'? Are they some third party utilities? Is 'spawn' part of the same toolset? How do they work?
You need to give us some more information. Do you know what the password is getting set to (I'd guess it will contain the PID)?
I'd guess that when you are SENDing you new password to /usr/bin/passwd, $$ is being expanded to the PID. If this is the case, all I can think to do is to modify the password value to escape any $ so that these are not expanded.
expect "Old password:"
send $(echo "$oldpas\r" | sed 's/\$/\\$/g')
It might work. Let me know - I'm curious!
Last edited by Damian Ibbotson; 10-02-03 at 09:41.