hi
i am having a c code which gives the output of my password in text format
i.e when i run my c code which which gives the password asfollows====>>>>>>
$./passwdprogram ======>>>>>>abc@123(this is the output)
now i have an expect script to remotely ssh which uses the password set in programme and works fine
if given in clear text format as follows
==========================================
#!/usr/bin/expect -f
set argu [lindex $argv 0]
set argg [lindex $argv 1]
set password "abc@123" ================here i want to change
spawn ssh user@<ip adress > sh portalhits $argu $argg
expect "^password:"
send "$password\r"
interact
==========================================
I want to use this in the following way
#!/usr/bin/expect -f
set argu [lindex $argv 0]
set argg [lindex $argv 1]
set password "./passwordprogramme" (in c) ================here i want to change
spawn ssh user@<ip adress> sh portalhits $argu $argg
expect "^password:"
send "$password\r"
interact
============================
so i want to figure that is there any way by which i can set the variable password with the output of the c code(./passwordprogramme) programme
can we do this by system() command .
Thanx