• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Executing A Shell Script...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Executing A Shell Script...


  • Subject: Re: Executing A Shell Script...
  • From: Albert Atkinson <email@hidden>
  • Date: Fri, 30 Aug 2002 08:50:46 -0500

Thanks for your assistance! I have one more question about this...how would I display the result of the script in an NSTextView? Like if I typed "ls /MY/PATH" in the Terminal, it would print out all the contents of the path. How would I take what it prints out and display it in my NSTextView? Would it just be something like:

[NSTextView setText: system("ls My/Path")];

Thanks again!

Albert

On Friday, August 30, 2002, at 08:32 AM, Rhon Fitzwater wrote:

I think you should just be able to use: system(). So if you wanted to do, say mkdir, all you have to do is
system("/bin/mkdir /DirMade");
I added /bin to it because you may sometime get a zsh error, which means it cant find the command, so I always put in the full path to be safe. Hope this helps.

-Rhon
On Friday, August 30, 2002, at 09:13 AM, Albert Atkinson wrote:

Greetings!

I was wondering if there was any way to execute a shell script from
Cocoa? I know in AppleScript you can do:

do shell script ("cd PATH/TO/FOLDER")

And it will execute that script without launching the Terminal or
anything like that. Is there a method in Cocoa for doing this? Like:

[MyShellScript do: @"cd PATH/TO/FOLDER"];

??? Thanks for your help in advance!

Albert
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Executing A Shell Script...
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Executing A Shell Script... (From: Rhon Fitzwater <email@hidden>)

  • Prev by Date: Re: NSSplitView
  • Next by Date: Re: Executing A Shell Script...
  • Previous by thread: Re: Executing A Shell Script...
  • Next by thread: Re: Executing A Shell Script...
  • Index(es):
    • Date
    • Thread