|Perl Monk, Perl Meditation|
Problem executing command via sshby mgalindez (Initiate)
|on Aug 23, 2019 at 15:45 UTC||Need Help??|
mgalindez has asked for the wisdom of the Perl Monks concerning the following question:
I need to execute a program in a remote machine, that takes its input from STDIN.
I created a user in such remote machine, and set my program as the shell for that account (so I don't need to provide shell access).
On my local node, I have this program:
What I expect is that I pass the name of the file as arguments of this program ($ARGV), and the contents of this file is fed as STDIN of the child I've spawn with open3. This should be received as STDIN of my remote program, and the results of the remote program would be printed on STDOUT.
This works well. However, my program only reads the first line, and then terminates.
If I do a manual test, and do ssh email@example.com, and type multiple lines of input, then things work as expected.