FutureBasic Logo

<<    Index    >> FutureBasic

unix   function / statement



Syntax
[ result = ] unix unixCommand

Description
This function/statement executes the unixCommand (CFString literal or variable) via a UNIX pipe and returns any results as a CFStringRef. Note: not all UNIX commands return a result.

This command replaces the former open "UNIX" command.

Examples

CFStringRef result = unix @"ls -A"
print results // should check result's string length before using - exercise for programmer
HandleEvents

-- or simply --
print unix @"ls -A"
HandleEvents

The 'touch' command doesn't return results, so the statement version is used
unix @"touch /Users/yourUserID/Desktop/someFile"
HandleEvents
Note
If your app is destined for Apple's Mac App Store, using CocoaUI calls instead of unix is a better approach.
Apple security makes it difficult to execute piped UNIX commands.