I'm just trying my hand in bash, so I wrote a simple program in C to count the number of characters in a file.
This is my C program:
#include <stdio.h>
int main()
{
int i, nc;
nc = 0;
i = getchar();
while (i!=EOF){
nc = nc + 1;
i = getchar();
}
printf("%d\n",nc);
return 0;
}
This is the bash command I'm using to compile and execute:
gcc sign.c < bright_side_of_life > output
My output file is completely empty though. Where am I going wrong?