#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

main()
{
	int fd,newfd;
	char buf[80];
	read(0,buf,80);
	write(1,buf,80);
	fd=open("/etc/passwd",O_RDONLY);
	close(0);
	newfd=dup(fd);
	if(newfd!=0)
	{
		perror("dup");
		exit(1);
	}
	close(fd);
	read(0,buf,80);
	write(1,buf,80);
}
