Print With Delay 0.6 ( with option)



/* Jeffrin Jose Licensed GPL v3 Copyright August 2010
GPL --> http://www.gnu.org/copyleft/gpl.html */

#include
#include
#include
#include

int main(int argc,char *argv[])
{
int count;
int i=0,getptr;
pid_t pid;
size_t length;
char array[20]="Happy Friendship Day";
/* printf("n Happy Friendship Day n"); */
pid=fork();
if (pid == 0)
{
setsid();
setenv("PS1","$",1);
/* getptr=getenv("PS1");
printf("%s",getptr); */
printf("n");
for(i=0;i<20;i++)
{
printf("%c",array[i]);
/* for(seconds=0;seconds<100000000;seconds++);*/
/* system("sleep 1s");*/
fflush(stdout);
usleep(100000);
}
printf(" ");

for(count=1;count <argc;count++)

{

printf("%s",argv[count]);
fflush(stdout);
usleep(100000);
}
printf("n");
length=strlen(argv[1]);
length= 21 + length;
/* printf("%d",length);*/
for(i=0;i<length;i++)
{
printf("%c",'-');
/* for(seconds=0;seconds<100000000;seconds++);*/
/* system("sleep 1s");*/
fflush(stdout);
usleep(100000);
}
printf("n");
}
/* printf("%d",pid); */
return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *