Skip to content

Instantly share code, notes, and snippets.

@szhu szhu/selfcompile.m forked from n-b/selfcompile.m
Last active May 14, 2018

What would you like to do?
A simple self-compiling objective-c file
/* 2>/dev/null
[[ -e "$COMPILED" ]] || clang $0 -o "$COMPILED" -framework Foundation
exec "$COMPILED" $@
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
NSLog(@"Hello %@",NSProcessInfo.processInfo.environment[@"USER"]);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.