💾 Archived View for thrig.me › blog › 2024 › 02 › 07 › greeting.c captured on 2024-07-09 at 03:17:50.

View Raw

More Information

⬅️ Previous capture (2024-03-21)

-=-=-=-=-=-=-

// greeting - show how to change the behavior of a program depending on
// the name it was invoked with
#include <stdio.h>
#include <string.h>

int
main(int argc, char *argv[])
{
	if (strcmp(argv[0], "./goodbye") == 0) {
		printf("goodbye\n");
	} else {
		printf("hello\n");
	}
}