Created
January 19, 2018 11:27
-
-
Save ruan65/e38cd5b72fc45e66aaa59ad4b1b301da to your computer and use it in GitHub Desktop.
run bash via java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
String[] cmd = new String[]{"/bin/sh", "/home/a/temp/notify.sh"}; | |
try { | |
Process pr = Runtime.getRuntime().exec(cmd); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment