the Cocoa bin/

  • Posted: 10 February 2002 11:24 AM

    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

         
  • Posted: 09 February 2002 09:12 AM #1

    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

         
  • Posted: 10 February 2002 11:21 AM #2

    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.

         
  • Posted: 10 February 2002 11:24 AM #3

    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.