1#include<stdio.h>2#include<stdlib.h>3#include<sys/types.h>4#include<sys/stat.h>5#include<fcntl.h>6#include<unistd.h>78intmain(int argc,char**argv){910if(argc !=2){11perror("the number of command line arguments is wrong.");12exit(1);13}1415int ifd;16int status;17int fd[2];18ssize_t cc;19pid_t ret;20char buf[1024];2122if(pipe(fd)<0){23perror("pipe");24exit(1);25}2627 ret =fork();28if(ret <0){29perror("fork");30exit(1);31}3233if(ret==0){34//行を数えて標準出力35}36else{37if((ifd =open(argv[1], O_RDONLY))==-1){38perror("open");39exit(1);40}41//read, writeなどを用いて連続的な重複行を除いた物を作る42}43}