I have a script that I didn’t write. When it is run, it outputs some information, then expects the user to press enter, and then outputs the last part of the information. This is what I need. I need to get that last part i.e. last line of output programmatically. When I run the script locally as follows:
RESULT=$(echo -ne '\n' | script $param)
I can get the output and process it, but when I try to run the same remotely i.e.
RESULT=$(echo -ne '\n' | ssh remoteserver script $param)
The script hangs. It Seems that the pipe of the new line does not work for the remote ssh.
How can I fix this?
The script takes input from terminal directly and is a perl script, just in case it matters