Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • are you in same box where you are trying to execute mention command. if out side try to use jsch or any other libaray Commented Feb 6, 2018 at 10:47
  • 1
    I dont think there is an executable named "[" on Linux which does what you want. And do you really want to check for the presence of some directory using an external command? Commented Feb 6, 2018 at 10:50
  • Hi @spandey15, yes, I am on the same host. Commented Feb 6, 2018 at 10:54
  • 1
    Hi @GyroGearless, basically it is an IF operator, it tries to check if the folder exists. It works fine in command line. Usually it is used in bash scripts. Commented Feb 6, 2018 at 10:54
  • Boolean successful = proc.waitFor()==0 && proc.exitValue()==0; there's no need to check exitValue() if you've just checked the return of waitFor() as they will be the same. Print the actual int value instead of creating a Boolean object. Commented Feb 6, 2018 at 11:06