You are here: Home → Forum Home → The Mac Observer Forums → Design & Create → Thread
the Cocoa bin/
-
I am curious about accessing Unix commands from Cocoa apps. Is it practical, or even feasible?
Signature
Seemed like a good idea at the time
-
I don’t know the commands for it but I’m sure it is imminently practical. There are a number of Cocoa apps out there that are really just wrappers for UNIX tools.
Signature
All statements are to be taken with a grain of salt
-
Use NSTask. It allows you to start another “task” from your app, and you can communicate with it. I recommend you use a NSTask to launch /bin/tcsh with no arguments, and then you can write commands to it just like in Terminal.
-
Actually, /bin/tcsh isn’t really necessary, because if you’re communicating with the shell through a Cocoa app, you probably won’t need tcsh’s autocompletion and spell checking. Just launch /bin/sh or whatever you want.

