I want to execute local script on remote machine with additional file descriptors.
#!/bin/bash
echo "first log"
echo "second log" >&3
I try to run it that way:
ssh remote_host 'bash -s' < test.sh >first.log 3>second.log
Only my first log is populated. For second it gives "Bad file descriptor" error.