Hi, > NSString *tempFilePath = @"/Users/john/OutCocoa.txt"; > NSString *commandLine = [NSString stringWithFormat:@"/sbin/ifconfig en0 | > grep ether | cut -d' ' -f 2 > \"%@\" 2>&1", tempFilePath]; > sprintf(cmd, "/bin/sh -c %s", [commandLine UTF8String]);
Quote the command. sprintf (cmd, "/bin/sh -c \"%s\"", [commandLine UTF8String]); But anyhow, as somebody pointed out, there are far better ways to get the MAC address of the en0 port than executing BSD commands in a subprocess. Vincent_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com