Its alsi worth noting that System.Environment is not initialized the same way when you double-click an app as when you open a terminal window. The environment for a terminal is typically with more detail as to make command-line calls a little easier.
BTW: On Mac there is no shell call needed. Just use
[code] Declare Function NSClassFromString Lib “Cocoa” (aClassName As CFStringRef) As Ptr
Declare Function processInfo lib “Cocoa” selector “processInfo” (obj_id as Ptr) as Ptr
Declare Function hostName lib “Cocoa” selector “hostName” (obj_id as Ptr) as CFStringRef
dim pi as Ptr = NSClassFromString(“NSProcessInfo”)
dim info as Ptr = processInfo(pi)