I tried to run String command ="gdb -p <124845> --batch -ex 'call shutdown(69u)'" or close() instead of shutdown(). Using Runtime.getRuntime().exec(command);
COMMAND GETS EXECUTED BUT HAS NO EFFECT ,
But when run in putty then it works fine.
PLEASE help ,i'm new to this.
My goal is to clear all connections to a java socket in linux machine.
-p 124845. The command with angle brackets should not work fine when it run in putty also.["gdb", "-p", "124845", "--batch", "-ex", "'call", "shutdown(69u)'"]. Can you see if the following answers your question? Java execute command doesn't work in codegdb --batch -ex UnknownCommandreturns 0.