/* get the command */ cmd = strtok(line, " \t\n"); /* get next word */ next = strtok(NULL, " \t\n"); /* check if this word contains ", if it does, fetch all words until next " */ if (strstr(next, "\"") != NULL) { message = strcat(next+1, strtok(NULL, "\"")); printf("%s\n", message); }