#include"myHeader.h"
main(int argc,char **argv)
{
char ch;
int fd;
fd=open(argv[1],O_RDONLY);
while(read(fd,&ch,1)==1)
{
printf("ch= %c ",ch);
write(1,&ch,1);
}
close(fd);
}
OutPut:
madan@madan-Lenovo-G570:~/madan/osconcepts$ ./a.out madan
welcome madan reddych= w ch= e ch= l ch= c ch= o ch= m ch= e ch= ch= m ch= a ch= d ch= a ch= n ch= ch= r ch= e ch= d ch= d ch= y ch=
hyderabad ch= h ch= y ch= d ch= e ch= r ch= a ch= b ch= a ch= d ch=
always truth wins ch= a ch= l ch= w ch= a ch= y ch= s ch= ch= t ch= r ch= u ch= t ch= h ch= ch= w ch= i ch= n ch= s ch=