filter_a.c

#include <unistd.h>
#include <errno.h>

#include "utils.h"

int main(int argc, char *argv[])
{
    char buffer[100];
    char output[100];
    int r;
    while((r = read(STDIN_FILENO, buffer, sizeof(buffer))) > 0) {
        int out_len = 0;
        for (int i = 0; i < r; i ++)
            if (buffer[i] != 'a')
                output[out_len ++] = buffer[i];
        exit_if(write(STDOUT_FILENO, output, out_len) == -1, "Can't write");
    }
    return 0;
}