Calling a wrapper from java, it complains about "stty: standard input: Invalid argument"

I call the shell command from the Process class from java and prints

"stty: standard input: Invalid argument" 

whether the command is correct or incorrect (normal shell command output is displayed). If I run the shell command in the shell, this error message will not appear.

The command looks something like this: {"/bin/csh", "-c", "echo hello"}

+5
source share
4 answers

Try using the -fcsh option to disable reading of .chsrc and .login files:

    {"/bin/csh", "-cf", "echo hello"}
+3
source

You call a command sttyfrom .profileor .bash_profile. You will have to redirect the standard error to /dev/null.

stty blah blah blah 2>/dev/null

stty -tty, Java .

+6

java.lang.Process:

" , , , Win16/DOS Microsoft Windows . ."

, java.lang.ProcessBuilder.

0

. , this

0
source

All Articles