<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Calling the Command Line from Cocoa</title>
	<atom:link href="http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/feed/" rel="self" type="application/rss+xml" />
	<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/</link>
	<description>my weblog.</description>
	<lastBuildDate>Fri, 03 Sep 2010 21:45:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Alex Akers</title>
		<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/comment-page-1/#comment-481</link>
		<dc:creator>Alex Akers</dc:creator>
		<pubDate>Sun, 15 Feb 2009 18:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/#comment-481</guid>
		<description>Used to get the primary mac address of the computer in order to run an mathematical permutation to get a unique &quot;computer code&quot;</description>
		<content:encoded><![CDATA[<p>Used to get the primary mac address of the computer in order to run an mathematical permutation to get a unique &#8220;computer code&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xcode newbie</title>
		<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/comment-page-1/#comment-441</link>
		<dc:creator>Xcode newbie</dc:creator>
		<pubDate>Tue, 20 Jan 2009 15:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/#comment-441</guid>
		<description>Thanks.  This is getting off topic but I&#039;d like to run some sqlite commands.  After executing folder change commands in the .sh file, these commands execute:

sqlite3 myDB.sqlite
.import dbArea.txt Area

When I run the .sh file from Terminal, I&#039;m at an sqlite prompt.  The import command doesn&#039;t execute.  Any ideas what&#039;s going on?</description>
		<content:encoded><![CDATA[<p>Thanks.  This is getting off topic but I&#8217;d like to run some sqlite commands.  After executing folder change commands in the .sh file, these commands execute:</p>
<p>sqlite3 myDB.sqlite<br />
.import dbArea.txt Area</p>
<p>When I run the .sh file from Terminal, I&#8217;m at an sqlite prompt.  The import command doesn&#8217;t execute.  Any ideas what&#8217;s going on?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent Gable</title>
		<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/comment-page-1/#comment-438</link>
		<dc:creator>Vincent Gable</dc:creator>
		<pubDate>Tue, 20 Jan 2009 00:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/#comment-438</guid>
		<description>What I would suggest doing is putting those dependent shell commands together in their own shell script, and then executing the shell script.
Once you have added the script, MyScript.sh, to your Xcode project, you can have the shell run it like:

NSString *pathToMyScript = [[NSBundle mainBundle] pathForResource:@&quot;MyScript&quot; ofType:@&quot;sh&quot;];
[[NSTask launchedTaskWithLaunchPath:@&quot;/bin/sh&quot; arguments:[NSArray arrayWithObject:pathToMyScript]] waitUntilExit];</description>
		<content:encoded><![CDATA[<p>What I would suggest doing is putting those dependent shell commands together in their own shell script, and then executing the shell script.<br />
Once you have added the script, MyScript.sh, to your Xcode project, you can have the shell run it like:</p>
<p>NSString *pathToMyScript = [[NSBundle mainBundle] pathForResource:@&#8221;MyScript&#8221; ofType:@&#8221;sh&#8221;];<br />
[[NSTask launchedTaskWithLaunchPath:@"/bin/sh" arguments:[NSArray arrayWithObject:pathToMyScript]] waitUntilExit];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xcode newbie</title>
		<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/comment-page-1/#comment-436</link>
		<dc:creator>Xcode newbie</dc:creator>
		<pubDate>Mon, 19 Jan 2009 14:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/#comment-436</guid>
		<description>Thanks.  This is great!  Is there a way to execute several commands within the same Terminal session?  I&#039;m calling executeShellCommandSynchronously  multiple times to traverse folders and and retreive contents of a file:

cd /
cd Users/theuser/Thefolder
vi somefile.txt

The problem is that each command executes in its own Terminal session.  So the second command gives a folder not found because I&#039;m still in the build/debug folder.   Any suggestions?  Thanks.</description>
		<content:encoded><![CDATA[<p>Thanks.  This is great!  Is there a way to execute several commands within the same Terminal session?  I&#8217;m calling executeShellCommandSynchronously  multiple times to traverse folders and and retreive contents of a file:</p>
<p>cd /<br />
cd Users/theuser/Thefolder<br />
vi somefile.txt</p>
<p>The problem is that each command executes in its own Terminal session.  So the second command gives a folder not found because I&#8217;m still in the build/debug folder.   Any suggestions?  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Repenning</title>
		<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/comment-page-1/#comment-213</link>
		<dc:creator>Jack Repenning</dc:creator>
		<pubDate>Thu, 13 Nov 2008 11:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/#comment-213</guid>
		<description>Thanks! Your ShellTask class was just what I needed.</description>
		<content:encoded><![CDATA[<p>Thanks! Your ShellTask class was just what I needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent Gable &#187; Restarting Your Cocoa Application</title>
		<link>http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/comment-page-1/#comment-187</link>
		<dc:creator>Vincent Gable &#187; Restarting Your Cocoa Application</dc:creator>
		<pubDate>Mon, 06 Oct 2008 00:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://vgable.com/blog/2008/03/05/calling-the-command-line-from-cocoa/#comment-187</guid>
		<description>[...] you can&#8217;t tell yourself to start up when you aren&#8217;t running. Here is one solution, use NSTask to run a very short script that you can embed right in your Objective-C code:  kill -9 YourPID open [...]</description>
		<content:encoded><![CDATA[<p>[...] you can&#8217;t tell yourself to start up when you aren&#8217;t running. Here is one solution, use NSTask to run a very short script that you can embed right in your Objective-C code:  kill -9 YourPID open [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
