Re: NSTask and piped commands
Re: NSTask and piped commands
- Subject: Re: NSTask and piped commands
- From: René v Amerongen <email@hidden>
- Date: Wed, 19 May 2010 00:04:50 +0200
Sorry for the late reaction. I did check every ten minutes Cocoabuilder and sometimes my mail, but I see that there where all ready replies before I got my own posting.
Op 18 mei 2010, om 22:13 heeft Jens Alfke het volgende geschreven:
>> I dont want to use a call to a bash script, because of sneaking in bad commands.
>
> As others said, it’s not a problem here because the command line is entirely hardcoded.
With the sample line, yes, but I was thinking of a piece of script on disk inside the xx.app folder.
>
> If you wanted to avoid using a shell, you’d have to start three separate NSTasks for the three commands (df, grep, awk) and hook the output pipe of one to the input of the next. I’m not sure how to do that.
I did think of that and did use that in the past because it was the only way that I did know off. Maybe just an imagination from me, but it looks slow all that moving of results to the next task.
>
> Of course, you could skip the grep and awk tasks and do the job yourself — looks like you’re just matching against a string, breaking the lines into pieces and then formatting the result. Probably three or four lines of Obj-C.
Yes!! for the awk command line I will it do it that way.
Anyway, because of other piped command lines that I need, I am still curious how to do it with the escaping of the tabs.
Thank you_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden