Skip to content

Instantly share code, notes, and snippets.

@Draphar
Last active May 6, 2019 14:36
Show Gist options
  • Save Draphar/0731da6f6df90a6b13d307e645f94527 to your computer and use it in GitHub Desktop.
Save Draphar/0731da6f6df90a6b13d307e645f94527 to your computer and use it in GitHub Desktop.
C program to set an exit code, for testing purposes
#include<stdlib.h>
int main(int argc, char* argv[]){
if(argv[1] == NULL) {
return 0;
} else {
return atoi(argv[1]);
}
}
curl https://gist.githubusercontent.com/Draphar/0731da6f6df90a6b13d307e645f94527/raw/b89c9d0b4f99b7d0a9f9136cd382630ce80ea7b3/exitcode.c -o exitcode.c
sudo gcc -o /usr/bin/exitcode exitcode.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment