0
일부 옵션이 첨부 된 셸을 작성한 후 문서에서 문자열을 찾기 위해 grep과 동일한 작업을 수행해야합니다.C에서 Linux에서 grep과 동일한 작업을 수행하는 프로세스를 구현하는 방법
void cmd_search(/*maybe I need arguments in here about what and where to find*/){
int status, result;
result = fork();
if (result == 0) {
char *cmd1[] = {"grep", (char*)0};//
execvp ("grep", cmd1);
//Here I don't know how to pass my arguments to find. This way I do the grep, but I can't tell what to find and where
나를 도와 줄 수 있습니까?
당신은 argc, argv에 익숙합니까? main (int argc, char * argv [])? –