#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSProcessInfo.h>
#include <Foundation/NSTask.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSString.h>
#include <Foundation/NSDictionary.h>

int
main()
{
NSDictionary *e;
id pool = [[NSAutoreleasePool alloc] init];
NSTask *task = [NSTask launchedTaskWithLaunchPath: @"/bin/ls" arguments: nil];

	[task waitUntilExit];
	printf("Exit status - %d\n", [task terminationStatus]);
	
	[pool release];
	pool = [[NSAutoreleasePool alloc] init];
	
	task = [NSTask new];
	e = [[[[NSProcessInfo processInfo] environment] mutableCopy] autorelease];
	[task setEnvironment: e];
	[task setLaunchPath: @"/bin/sh"];
	[task setArguments: [NSArray arrayWithObjects: @"-c", @"echo $PATH", nil]];
	[task launch];
	[task waitUntilExit];
	[task release];
	[pool release];
	printf("nstask test complete\n");
	
	exit(0);
}

