Skip to content

Instantly share code, notes, and snippets.

@cirpo
Created August 9, 2010 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirpo/515247 to your computer and use it in GitHub Desktop.
Save cirpo/515247 to your computer and use it in GitHub Desktop.
<HTML>
<BODY>
<%
String cmd = "/tmp/test.sh" ;
Runtime run = Runtime.getRuntime() ;
Process pr = run.exec(cmd) ;
InputStream in = pr.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
return sb.toString();
%>
<h1>Script <% out.println(cmd); %> lanciato!</h1>
</BODY>
</HTML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment