So I am trying to basically ssh into a server and run a local expect script on there. I tried to follow something similar to how you'd do a bash command i.e.
ssh -A user@remote "bash -s" < ./script "arg1" "arg2"
I did it in the format of this for my expect script:
ssh -A user@remote "expect" < ./script "arg1" "arg2"
But I keep getting the error of:
couldn't read file "arg1": No such file or directory.
I assume it is trying to read my first argument as a file and have tried to remedy this by looking at this post: How can I execute local script on remote machine and include arguments? However, none of these solutions are working for me. What could be the problem?