cat ~/.ssh/id_rsa.pub | ssh root@host 'cat >> .ssh/authorized_keys'でパイプ コマンドを自動化したいexpect。コマンドを使用してspawnコマンドを実行する場合、
spawn cat ~/.ssh/id_rsa.pub | ssh root@host 'cat >> .ssh/authorized_keys'
エラーメッセージをスローし、
cat |: No such file or directory
cat ssh: No such file or directory
...
パイプされたコマンドを生成するにはどうすればよいですか?