/* Author : Rick van der Zwet * S-number : 0433373 * Version : $Id: memory.h 363 2007-12-03 06:07:31Z rick $ * Copyright : FreeBSD Licence * Description : C sub of grep -e '^BUS2 ' */ #include #include #include #include int main(int argc, char *argv[]) { const int MAX_LINE = 128; char line[MAX_LINE]; /* Fetch line from stdin */ while (fgets(line, MAX_LINE, stdin) != NULL) { /* Compare wether first part matches */ if ((strncmp(line, "BUS2 ", 5) ) == 0) printf("%s",line); } exit(EX_OK); }