Runtime.exec()로 pipe 포함 명령어 실행

  • helloworld
    (stdio.h)
  • helloworld's Avatar 이 글의 작성자
  • Offline
  • Junior
  • Junior
더보기
14 Mar 2016 19:03 - 14 Mar 2016 19:07 #564 작성자: helloworld
helloworld 님의 글: Runtime.exec()로 pipe 포함 명령어 실행
자바 Runtime.exec()로 명령어를 실행할 때, | (pipe)가 들어있으면 안되는 문제.

예를 들어 "ps -ef | grep pmon" 실행을 위하여 다음과 같이 실행.

String cmd = "ps -ef | grep pmon";
Process p = Runtime.getRuntime().exec(cmd);

하지만 안됨. 그렇지만 다음과 같이 실행하면 됨.



[로그인을 하면 내용 확인이 가능합니다]
Time to create page: 0.050 seconds
Powered by Kunena Forum