The Scala ProcessBuilder uses the underlying Java ProcessBuilder, which has its own whitespace treatment routine that breaks SSH commands that otherwise work on the shell. I'm trying to get the Perl backticks and system() behavior where the interpreter runs an underlying shell and executes the shell command. Is there something similar for Java/Scala?
I'm trying this, specifically:
ssh REMOTE_SERVER '/usr/bin/tail -n 25 /var/log/messages'
Where /usr/bin/tail is the right path to the command, double checked it.
To get the latest log messages from a server. It works fine on the shell, but it breaks on the ProcessBuilder with No Such file or directory. Obviously ProcessBuilder quoted or escaped the command somehow and broke it.
Thanks in advance for any ideas.