Skip to content

Instantly share code, notes, and snippets.

@moreaki
Forked from n-b/selfcompile.m
Created November 6, 2013 23:59
Show Gist options
  • Save moreaki/7346481 to your computer and use it in GitHub Desktop.
Save moreaki/7346481 to your computer and use it in GitHub Desktop.
/*/../bin/ls > /dev/null
COMPILED=${0%.*}
clang $0 -o $COMPILED -framework Foundation;
$COMPILED; rm $COMPILED; exit;
*/
#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