머.. 스크립트라고 해서 다를 건 없었다.
그냥 execl("경로 + 파일명", "파일명", "인자1", ... , NULL);
예를 들어
/root/test.sh를 실행하고 eth0 down 이라는 인자가 필요 하다면
execl("/root/test.sh", "test.sh", "eth0", "down", NULL);
이렇게 하면된다.
참 쉽죠잉?
[링크 : http://www.gnu.org/software/libc/manual/html_node/Process-Creation-Example.html]
[링크 : http://www.opengroup.org/onlinepubs/009695399/functions/exec.html]
그냥 execl("경로 + 파일명", "파일명", "인자1", ... , NULL);
예를 들어
/root/test.sh를 실행하고 eth0 down 이라는 인자가 필요 하다면
execl("/root/test.sh", "test.sh", "eth0", "down", NULL);
이렇게 하면된다.
참 쉽죠잉?
[링크 : http://www.gnu.org/software/libc/manual/html_node/Process-Creation-Example.html]
[링크 : http://www.opengroup.org/onlinepubs/009695399/functions/exec.html]
'Linux' 카테고리의 다른 글
ifconfig broadcast 설정 안해도 된다! (0) | 2009.08.10 |
---|---|
ifconfig Bcast 계산방법 (0) | 2009.08.07 |
execl()를 이용한 쉘 스크립트 실행하기 - execute shell script using execl() (2) | 2009.08.07 |
busybox route 명령어 (0) | 2009.08.06 |
grep -r 옵션은 주의! (0) | 2009.08.06 |
쉘스크립트 - 변수 / 변수 치환 (2) | 2009.08.04 |
댓글을 달아 주세요
옵션 처리는 어떻게 하죠? -rf 이런거요
2010.11.30 18:45 [ ADDR : EDIT/ DEL : REPLY ]스페이스로 구분되는 모든 내용은
2010.11.30 21:18 신고 [ ADDR : EDIT/ DEL ]별도의 " "으로 넣어 주시면 됩니다.
grep -rf는
execl("/bin/grep", "grep", "-rf", NULL);
이런식으로 해주시면 되겠습니다.