• 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
Using NSTask and NSPipe to perform a shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSTask and NSPipe to perform a shell script


  • Subject: Using NSTask and NSPipe to perform a shell script
  • From: Keith Blount <email@hidden>
  • Date: Tue, 5 Sep 2006 14:15:48 -0700 (PDT)

Hello,

I have a rather basic RTFM question, but unfortunately
reading the docs and browsing several online tutorials
on this one (for instance at CocoaDevCentral and
borkware) has only left me confused. I have several
shell scripts that I want to run through a Cocoa app.
My program provides support for exporting to several
text formats, and a user has sent me some shell
scripts that will expand the range of possible
formats. Unfortunately, despite being comfortable with
Cocoa, my knowledge of using shell-scripts is rather
poor, so transferring this into a Cocoa app is proving
problematic. I know I need to use NSTask and NSPipe,
but am having difficulties finding the correct way of
doing this for my own script. This is how I would run
my script in terminal:

cat readme.markdown | md2latex.sh > readme.tex

(This just uses a script to convert "readme.markdown"
to a LaTeX file - it uses MultiMarkDown to do so.)

If anyone could give me some pointers on how to get
this working in an NSTask wrapper, I would be _very_
grateful. I have found some basic stuff on getting
using the pipes with NSPipe, but using NSTask along
with "cat" and the ">" output has me baffled.

Sorry if this seems incredibly obvious to many.

Many thanks in advance,
Keith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using NSTask and NSPipe to perform a shell script
      • From: "Bruce Johnson" <email@hidden>
  • Prev by Date: Re: InterfaceBuilder programming info
  • Next by Date: Re: InterfaceBuilder programming info
  • Previous by thread: Need suggestions for a crash in NSTable View...
  • Next by thread: Re: Using NSTask and NSPipe to perform a shell script
  • Index(es):
    • Date
    • Thread