I'm working on a project that requires the use of a test framework called Appium in Java. The Appium library is attempting to run the following script on my machine to find out where my NodeJS install is located (not important that it is node):
#!bin/sh
OUTPUT="$(npm root -g)"
echo "${OUTPUT}"
exit
This script is executed during my JUnit unit tests in Java explicitly with bash. See this link to see the code that Appium uses to run the script. On my system, if I execute this from a shell (using zsh, bash, or sh), I get the following output:
/home/me/node-v8.9.0-linux-x64/lib/node_modules
Great. For some reason, when that same script is running in the environment that is set up by my IDE (IntelliJ), this is the output:
/home/me/node-v8.9.0-linux-x64/lib/node_modules
[H[2J
Regardless of whether or not this was a good idea on the part of Appium, its breaking because of the extra \r\r\n[H[2J
. I usually launch IntelliJ through a program called GnomeDO on Ubuntu MATE. After seeing that my $PATH
in IntelliJ was different at run time than what I expected, I closed it out and launched it form my shell instead. The $PATH
was right and the trailing output stopped.
What can be different about launching an application from my desktop environment in Linux and launching it from my shell that would lead to trailing non-readable characters?
echo -e '\e[H\e[2J'
from a shell and you'll see what I mean. Don't know if that will help identify the cause but... – B Layer Nov 05 '17 at 03:09echo
command I specified in that terminal? – B Layer Nov 05 '17 at 23:26.trim()
do nothing because it didn't end in whitespace, etc. – Anthony Naddeo Nov 06 '17 at 02:10clear
command) – Jeff Schaller Nov 06 '17 at 11:08