solotim solotim - 1 year ago 117
Java Question

Invoking shell from java, it complaints "stty: standard input: Invalid argument"

I invoke a shell command by Process class from java and it prints

"stty: standard input: Invalid argument"

no matter whether the command is right or wrong (normal output of shell command is shown too). If I run the shell command in shell, no such error message is shown.

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

Answer Source

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

    {"/bin/csh", "-cf", "echo hello"}