Notice
Recent Posts
Recent Comments
Link
목록shellscript (1)
SeouliteLab
[Java/자바] 쉘 스크립트 실행
Java에서는 외부 프로세스를 실행하여 쉘 스크립트를 실행할 수 있습니다. 이를 통해 다른 프로그램이나 명령행 도구를 실행하고 결과를 가져올 수 있습니다. 다음은 Java에서 쉘 스크립트를 실행하는 여러 가지 방법을 살펴보겠습니다. 예제 1: Runtime 클래스를 사용한 방법 public class ShellScriptExample1 { public static void main(String[] args) { try { String command = "ls -l"; Process process = Runtime.getRuntime().exec(command); int exitCode = process.waitFor(); System.out.println("Exit Code: " + exitCode); ..
프로그래밍
2024. 3. 10. 00:56