Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
A simple self-compiling objective-c file
/* 2>/dev/null
COMPILED=${0%.*}
[[ -e "$COMPILED" ]] || clang $0 -o "$COMPILED" -framework Foundation
exec "$COMPILED" $@
*/
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
@autoreleasepool
{
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.