Skip to content
Advertisement

Tag: unix

Decrease the number of calls

I have arraylist of filenames (java) and I want to delete these files using rm but it is time consuming can I do batching using xargs or something else which can help to delete files faster. Answer Don’t use rm. Use Java. As others have pointed out, spawning a process is much slower than doing it in your program. Also,

How do I trigger the default signal handling behavior?

In my Java application I want to capture SIGINTs, do some pre-processing, and then let the default behavior (process termination) run. I would think I could do something like this: However when I send at SIGINT to this application, I get a SEGV: It seems SignalHandler.SIG_DFL is not meant to be called directly (even from other signal handling code). So

My JSch session doesn’t execute command

I’m trying to write a Java code that can ssh into a Unix server and reset a user’s password. So I tried to implement some of the code found in SO. Eg. Sending commands to remote server through ssh by Java with JSch Take commands(password) from string and set as InputStream to Unix servers in Java (JSCH) Using JSch ChannelExec,

Advertisement