I wrote a program that loops indefinitely and calls the exit() function if exit 0 was occurred. I got a weird error message when I tried to git commit even though the program worked fine when I ran the your_program bash script:
remote: [tester::#PN5] Expected prompt ("$ ") but received “”
remote: [tester::#PN5] Assertion failed.
remote: [tester::#PN5] Test failed
The code I used was: #include <stdio.h> #include <stdlib.h> #include <string.h>
int main() {
char input [100];
while(1){
fflush(stdout);
printf("$ ");
fgets(input, 100, stdin);
input[strlen(input) - 1] = '\0';
if (!strcmp(input, "exit 0"))
exit(0);
int i = 0;
printf("%s: command not found\n", input);
fprintf(stderr, "%d", i);
}