cat > fenfa_sshkey.exp <#!/usr/bin/expect
    if { \$argc != 2 } {
    send_user “You have to have two parameters \n”
    exit
    }
    set file [lindex \$argv 0]
    set host [lindex \$argv 1]
    set password “gpadmin”
    spawn ssh-copy-id -i \$file gpadmin@\$host
    expect {
    “yes/no” {send “yes\r”;exp_continue}
    “password:” {send “\$password\r”}
    }
    expect eof
    EOF