1- is there any way to turn off interactive login?
Yes, use public key authentication or sshpass to enter passwordsshpass to enter password.
2- how can I run script file via spawn ssh ?
Yes, use expect scriptexpect script. If you want to run some other script inside (awk), you need to escape the special characters (\$).