My expect script
#!/usr/bin/expect -f
#I tried replacing sh - with bash -s still no positive results
spawn ssh xxxx@yyyy "sh -" < test.sh
expect "password: "
send "zzzzz\r"
expect "$ "
This command works well if executed in the terminal
ssh xxxx@yyyy "sh -" < test.sh
But if I execute it via expect
script; it fails.
This is the output if I execute it via the expect script. May I know where I am going wrong
bash: test.sh: No such file or directory
P.S : Yes, the file exists and the credentials are right.
wrong forum
and posted it here, but couldn't unfortunately delete it there