<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Excursus &#187; UNIX</title>
	<atom:link href="http://markelikalderon.com/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://markelikalderon.com</link>
	<description>Philosophy and Text</description>
	<lastBuildDate>Tue, 27 Dec 2011 23:01:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Dirty Prompts</title>
		<link>http://markelikalderon.com/2009/01/16/dirty-prompts/</link>
		<comments>http://markelikalderon.com/2009/01/16/dirty-prompts/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 02:47:47 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[UNIX]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/?p=616</guid>
		<description><![CDATA[Playing with your bash prompt can seem like nothing more than an idle diversion. It is an idle diversion, it is just the &#8220;nothing more&#8221; bit that I would argue with. In a previous post I discussed how the bash prompt can reflect what git branch you are on. Now that&#8217;s useful. Seriously. But what [...]]]></description>
			<content:encoded><![CDATA[<p>Playing with your bash prompt can seem like nothing more than an idle diversion. It <em>is</em> an idle diversion, it is just the &#8220;nothing more&#8221; bit that I would argue with. In a previous <a href="http://markelikalderon.com/blog/2008/06/11/bash-prompt-redux/">post</a> I discussed how the bash prompt can reflect what git branch you are on. Now that&#8217;s useful. Seriously. But what about the &#8220;dirty state&#8221; of the branch&#8212;whether or not there is any uncommitted changes. I have gotten into the habit of running <code>git status</code> before I do anything in large part to check the dirty status of the branch. Couldn&#8217;t this reflex be automated? And reflected in the bash prompt? Yes, yes it can. Inspired by this <a href="http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/">post</a> and <a href="http://henrik.nyh.se/2008/12/git-dirty-prompt">this</a>, I decided to update my bash prompt once again.</p>

<script src="http://gist.github.com/47772.js"></script>

<p>Here is a screenshot illustrating the clean and then dirty state of the development branch.</p>

<a href="http://markelikalderon.com/wp-content/uploads/2009/01/dirty_prompt.jpg"><img src="http://markelikalderon.com/wp-content/uploads/2009/01/dirty_prompt.jpg" alt="Dirty prompt" title="dirty_prompt" width="505" height="343" class="size-full wp-image-620" /></a>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2009/01/16/dirty-prompts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Prompt Redux</title>
		<link>http://markelikalderon.com/2008/06/11/bash-prompt-redux/</link>
		<comments>http://markelikalderon.com/2008/06/11/bash-prompt-redux/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 19:09:14 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[UNIX]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2008/06/11/bash-prompt-redux/</guid>
		<description><![CDATA[OK, so you know a meeting is boring when you would rather redo your bash prompt. (And, yes, as a consequence, I have come to appreciate the point of running a headless meeting.) I wanted my bash prompt to tell me a number of things: Who am I? Where am I? Which branch of a [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so you know a meeting is boring when you would rather <a href="http://markelikalderon.com/blog/2007/11/24/full-paths-and-the-multiline-shell-prompt/">redo</a> your bash prompt. (And, yes, as a consequence, I have come to appreciate the point of running a headless meeting.) I wanted my bash prompt to tell me a number of things:</p>

<ol>
<li>Who am I?</li>
<li>Where am I?</li>
<li>Which branch of a <a href="http://git.or.cz/" title="Git - Fast Version Control System">Git</a> repository am I on?</li>
</ol>

<p>I wanted color. I wanted a multiline prompt. I wanted it all!</p>

<p>Actually it was pretty easy. Here it is, explanation to follow:</p>

<pre class="textmate-source"><span class="source source_shell">source <span class="keyword keyword_operator keyword_operator_tilde keyword_operator_tilde_shell">~</span>/.git-completion.sh

<span class="storage storage_modifier storage_modifier_shell">export</span> PS1=<span class="string string_quoted string_quoted_single string_quoted_single_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">'</span>\[\e[0;32m\]\w\[\e[1;33m\]$(__git_ps1 "(%s)")\[\e[0m\]\n\u $ <span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">'</span></span></span></pre>

<p>The first line loads .git-completion.sh a script distributed with Git that provides autocompletion for Git. Cool! But it also provides the function at work in:</p>

<pre class="textmate-source"><span class="source source_shell"><span class="string string_interpolated string_interpolated_dollar string_interpolated_dollar_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">$(</span>__git_ps1 <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span> (%s)<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">)</span></span></span></pre>

<p>This will display the branch currently checked out when you are in a Git repository.</p>

<p>The characters:</p>

<pre class="textmate-source"><span class="source source_shell"><span class="constant constant_character constant_character_escape constant_character_escape_shell">\[</span> <span class="constant constant_character constant_character_escape constant_character_escape_shell">\]</span></span></pre>

<p>wrap nonprinting characters, in this case, the color codes:</p>

<pre class="textmate-source"><span class="source source_shell"><span class="constant constant_character constant_character_escape constant_character_escape_shell">\e</span>[0<span class="keyword keyword_operator keyword_operator_list keyword_operator_list_shell">;</span>32m
<span class="constant constant_character constant_character_escape constant_character_escape_shell">\e</span>[1<span class="keyword keyword_operator keyword_operator_list keyword_operator_list_shell">;</span>33m
<span class="constant constant_character constant_character_escape constant_character_escape_shell">\e</span>[1<span class="keyword keyword_operator keyword_operator_list keyword_operator_list_shell">;</span>33m</span></pre>

<p>Finally:</p>

<pre class="textmate-source"><span class="source source_shell"><span class="constant constant_character constant_character_escape constant_character_escape_shell">\w</span>
<span class="constant constant_character constant_character_escape constant_character_escape_shell">\n</span>
<span class="constant constant_character constant_character_escape constant_character_escape_shell">\u</span></span></pre>

<p>gives you the name of the current directory, a new line, and your user name, respectively.</p>

<p>Well a picture is worth a thousand words:
<img src="http://markelikalderon.com/wp-content/uploads/2008/06/bash-prompt.png" alt="Bash Prompt" /></p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2008/06/11/bash-prompt-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remembrance of Things Past</title>
		<link>http://markelikalderon.com/2008/05/31/remembrance-of-things-past/</link>
		<comments>http://markelikalderon.com/2008/05/31/remembrance-of-things-past/#comments</comments>
		<pubDate>Sat, 31 May 2008 18:16:14 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/?p=404</guid>
		<description><![CDATA[In a previous post I discussed bash emacs mode&#8212;a convenient way to get around the bash command line quicker. Taking the time to learn these commands definitely yields a welcome boost to productivity. (And if you cannot remember them at first there is a bash cheat sheet.) I recently learned a few things about bash [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous <a href="http://markelikalderon.com/blog/2007/12/30/bash-emacs-mode/">post</a> I discussed bash emacs mode&#8212;a convenient way to get around the bash command line quicker. Taking the time to learn these commands definitely yields a welcome boost to productivity. (And if you cannot remember them at first there is a bash <a href="http://markelikalderon.com/blog/2008/05/28/cheat-sheets/">cheat sheet</a>.)</p>

<p>I recently learned a few things about bash history that&#8217;s made me more productive on the command line, so I thought I would share.</p>

<h1>Searching Bash History</h1>

<p>Almost anyone who has spent any time at all on the command line will know that you can move backwards and forwards through the history of previous commands with the up and down arrow. Suppose, however, you want to rerun a previous command issued several command lines before. You could bang away at the up arrow. But this is tedious and error prone&#8212;you can easily overshoot the target command line.</p>

<p>Fortunately there&#8217;s a better way. Bash allows you to search backwards through your history with &#x2303;R. After typing &#x2303;R begin typing the string that you are searching for and the bash shell will return the most recent matching string. To search further back in your history for other matches hit &#x2303;R as many times as necessary. Nice.</p>

<h1>Old School</h1>

<p>The bash history predates the emergence of arrows on keyboards. So there are ways to move through bash history with these. Thus:</p>

<pre class="textmate-source"><span class="source source_shell"><span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">!!</span></span></pre>

<p>takes you to the previous command line. What&#8217;s the point, you might wonder? Why bother to use three keystrokes when one (up arrow) will do? Well, you can use&#160;!! with other elements of a command line:</p>

<pre class="textmate-source"><span class="source source_shell">$ tree
-bash: tree: command not found
$ <span class="keyword keyword_operator keyword_operator_tilde keyword_operator_tilde_shell">~</span>/bin/<span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">!!</span>
<span class="keyword keyword_operator keyword_operator_tilde keyword_operator_tilde_shell">~</span>/bin/tree</span></pre>

<p>Nothing similar can be accomplished with the up arrow.</p>

<p>The bash history is a <em>numbered</em> list of command lines issued to the shell. You can select a particular command line using&#160;!n where n is the number of the command.</p>

<p>One of the most useful commands for traversing bash history is&#160;!$ which gives the last <em>argument</em> of the previous command:</p>

<pre class="textmate-source"><span class="source source_shell">$ mkdir -p myproject/src
$ cd <span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">!</span>$
$ PWD
/Users/markelikalderon/myproject/src</span></pre>

<p>Another useful command is&#160;!* which gives <em>all</em> of the previous commands. This can be useful for correcting (sadly inevitable) typing errors:</p>

<pre class="textmate-source"><span class="source source_shell">$ sbn commit -m <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>Initial commit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>
bash: sbn: command not found
$ svn <span class="keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell">!</span>*
svn commit -m <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>Initial commit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>
</span></pre>

<p>Another way of dealing with this typo is to use a quick substitution with the caret ^.</p>

<pre class="textmate-source"><span class="source source_shell">$ sbn commit -m <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>Initial commit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span>
-bash: sbn: command not found
$ ^sbn^svn
svn commit -m <span class="string string_quoted string_quoted_double string_quoted_double_shell"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_shell">"</span>Initial commit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_shell">"</span></span></span></pre>

<p>There&#8217;s more, much more, that can help you traverse the command line efficiently. As ever, RTFM, baby.</p>

<p><strong>Update</strong>: There is more on bash history on the <a href="http://blog.macromates.com/2008/working-with-history-in-bash/">TextMate Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2008/05/31/remembrance-of-things-past/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Meme</title>
		<link>http://markelikalderon.com/2008/05/10/meme/</link>
		<comments>http://markelikalderon.com/2008/05/10/meme/#comments</comments>
		<pubDate>Sat, 10 May 2008 20:47:56 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/?p=388</guid>
		<description><![CDATA[$ history &#124; awk '{print $2}' &#124; sort &#124; uniq -c &#124; sort -rn &#124; head 123 cd 78 ls 27 git 26 svn 14 man 13 mate 12 mkdir 10 sudo 6 ssh 5 most]]></description>
			<content:encoded><![CDATA[<pre><code>$ history | awk '{print $2}' | sort | uniq -c | sort -rn | head
 123 cd
  78 ls
  27 git
  26 svn
  14 man
  13 mate
  12 mkdir
  10 sudo
   6 ssh
   5 most
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2008/05/10/meme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the Literary Origin of UNIX</title>
		<link>http://markelikalderon.com/2008/04/16/on-the-literary-origin-of-unix/</link>
		<comments>http://markelikalderon.com/2008/04/16/on-the-literary-origin-of-unix/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 21:53:29 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[History]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2008/04/16/on-the-literary-origin-of-unix/</guid>
		<description><![CDATA[Earlier I noted how current writing technology tends to be the dominant metaphor of the mind. Related to this, is the tendency for writing technology to make a technological platform. Texting was the killer app for the cell phone, and the wordprocessor was the killer app for the PC. But before that, there was UNIX, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://markelikalderon.com/wp-content/uploads/2008/04/pdp-7.jpg" alt="Pdp 7" /></p>

<p><a href="http://markelikalderon.com/blog/2007/04/18/easily-twisted-on-journeys/">Earlier</a> I noted how current writing technology tends to be the dominant metaphor of the mind. Related to this, is the tendency for writing technology to make a technological platform. Texting was the killer app for the cell phone, and the wordprocessor was the killer app for the PC. But before that, there was UNIX, and the killer app for UNIX was <a href="http://www.troff.org/">troff</a>.</p>

<p>Part of the Documenter&#8217;s Workbench (DWB), troff was first used to process documents in the Bell Labs patent department. Dennis Ritchie describes the event in <a href="http://cm.bell-labs.com/cm/cs/who/dmr/hist.html">&#8220;The Evolution of the Unix Time-sharing System&#8221;</a>:</p>

<blockquote>
  <p>At the time of the placement of the order for the PDP-11, it had seemed natural, or perhaps expedient, to promise a system dedicated to word processing. During the protracted arrival of the hardware, the increasing usefulness of PDP-7 Unix made it appropriate to justify creating PDP-11 Unix as a development tool, to be used in writing the more special-purpose system. By the spring of 1971, it was generally agreed that no one had the slightest interest in scrapping Unix. Therefore, we transliterated the roff text formatter into PDP-11 assembler language, starting from the PDP-7 version that had been transliterated from McIlroy&#8217;s BCPL version on Multics, which had in turn been inspired by J. Saltzer&#8217;s runoff program on CTSS. In early summer, editor and formatter in hand, we felt prepared to fulfill our charter by offering to supply a text-processing service to the Patent department for preparing patent applications. At the time, they were evaluating a commercial system for this purpose; the main advantages we offered (besides the dubious one of taking part in an in-house experiment) were two in number: first, we supported Teletype&#8217;s model 37 terminals, which, with an extended type-box, could print most of the math symbols they required; second, we quickly endowed roff with the ability to produce line-numbered pages, which the Patent Office required and which the other system could not handle.</p>
  
  <p>During the last half of 1971, we supported three typists from the Patent department, who spent the day busily typing, editing, and formatting patent applications, and meanwhile tried to carry on our own work. Unix has a reputation for supplying interesting services on modest hardware, and this period may mark a high point in the benefit/equipment ratio; on a machine with no memory protection and a single .5&#160;MB disk, every test of a new program required care and boldness, because it could easily crash the system, and every few hours&#8217; work by the typists meant pushing out more information onto DECtape, because of the very small disk.</p>
  
  <p>The experiment was trying but successful. Not only did the Patent department adopt Unix, and thus become the first of many groups at the Laboratories to ratify our work, but we achieved sufficient credibility to convince our own management to acquire one of the first PDP 11/45 systems made.</p>
</blockquote>

<p>Troff interprets a presentational markup and has a number of preprocessors for specialized tasks such as the construction of tables. As a modularized system connected by text streams, troff anticpates more modern systems for document production such as <a href="http://www.latex-project.org/" title="LaTeX project: LaTeX &ndash; A document preparation system">LaTeX</a> and <a href="http://en.wikipedia.org/wiki/XML" title="XML - Wikipedia, the free encyclopedia">XML</a> (though these represent an increasing move away from presentational to structural markup). For more information about troff see <a href="http://www.faqs.org/docs/artu/ch08s02.html">chapter 8</a> and <a href="http://www.faqs.org/docs/artu/ch18s03.html#id3001604">chapter 18</a> of the <a href="http://www.faqs.org/docs/artu/">Art of Unix Programming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2008/04/16/on-the-literary-origin-of-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running VC</title>
		<link>http://markelikalderon.com/2008/03/23/running-vc/</link>
		<comments>http://markelikalderon.com/2008/03/23/running-vc/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 00:13:31 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[XeTeX]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2008/03/23/running-vc/</guid>
		<description><![CDATA[After posting about the version control bundle, I gave it a test spin. The version control bundle requires GNU awk. If gawk is not installed on your *nix system, this script will do it for you: #!/bin/sh # # installgawk.sh # # A bash script to install the latest version of GNU awk. Be sure [...]]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://markelikalderon.com/blog/2008/03/12/the-version-control-bundle/">posting</a> about <a href="http://www.ctan.org/tex-archive/support/vc/">the version control bundle</a>, I gave it a test spin.</p>

<p>The version control bundle requires <a href="http://www.gnu.org/software/gawk/" title="Gawk - GNU Project - Free Software Foundation (FSF)">GNU awk</a>. If gawk is not installed on your *nix system, this script will do it for you:</p>

<pre><code>#!/bin/sh
#
# installgawk.sh
#
# A bash script to install the latest version of GNU awk. Be sure to set the variables to the desired values. 
#
# http://www.gnu.org/software/gawk/
#
# Mark Eli Kalderon 2008-03-22

# Gawk. Change to the desired version if necessary
VER="3.1.6"
GAWK="gawk-${VER}"

# Build directories. Change to the desired directories if necessary.
GBLDDIR=/var/tmp/${GAWK}-build

# Create gawk build directory, but save source files if they exist.
test -d ${GBLDDIR} || mkdir ${GBLDDIR}
test -d ${GBLDDIR}/${GAWK} &amp;&amp; /bin/rm -rf ${GBLDDIR}/${GAWK}
cd $GBLDDIR

# Download and unpack gawk source.
curl http://ftp.gnu.org/gnu/gawk/${GAWK}.tar.gz -O
tar -xvzf ${GAWK}.tar.gz
cd ${GAWK}

# Configure and build gawk.
./configure
make
make check

# Install gawk (in /usr/local/bin/). Will prompt for password.
sudo make install
</code></pre>

<p>As of version 0.3, the vc bundle supports <a href="http://bazaar-vcs.org/">bazaar</a>, <a href="http://git.or.cz/" title="Git - Fast Version Control System">git</a>, and <a href="http://subversion.tigris.org/" title="subversion.tigris.org">subversion</a> and runs on Windows and unices. Within the vc directory there are subdirectories for each of these cases:</p>

<ul>
<li>bzr-unix/</li>
<li>bzr-windows/</li>
<li>git-unix/</li>
<li>git-windows/</li>
<li>svn-unix/</li>
<li>svn-windows/</li>
</ul>

<p>Each of these subdirectories contains a pair of scripts. As I am on OS X and wanted to see how well this would work with git, I used the scripts in git-unix/:</p>

<ul>
<li>vc</li>
<li>vc-git.awk</li>
</ul>

<p>Copy these to the root directory of your repository. vc is a shell script that extracts version control information and writes it to a new file, vc.tex. vc does this by calling vc-git.awk to process the output of git status and git log. To use these scripts, put the following in the preamble of your LaTeX document:</p>

<pre><code>\immediate\write18{sh ./vc}
\input{vc}
</code></pre>

<p>\write18 allows you to call shell scripts when running LaTeX. Most TeX installations has \write18 disabled by default for security reasons. That&#8217;s a good thing. Rather than enabling this globally, you can enable this on an as needed basis, by running pdflatex or xelatex with the -shell-escape argument.</p>

<p>vc.tex defines the following macros which can now be used in your LaTeX document:</p>

<ul>
<li><strong>\VCRevision</strong> current (maximum) working copy revision number </li>
<li><strong>\VCRevisionMod</strong> as \VCRevision, but with an additional note if the working copy contains modiﬁed ﬁles </li>
<li><strong>\VCAuthor</strong> author of the last check-in operation </li>
<li><strong>\VCDateRAW</strong> date of last check-in in native format of the VCS software </li>
<li><strong>\VCDateISO</strong> date of last check-in in ISO format YYYY-MM-DD </li>
<li><strong>\VCDateTEX</strong> date of last check-in in TeX format YYYY/MM/DD </li>
<li><strong>\VCTime</strong> time of last check-in </li>
<li><strong>\VCModifiedText</strong> contains the note shown in macro \VCRevisionMod if there were modiﬁed ﬁles. This macro can be redeﬁned by the user. </li>
<li><strong>\VCModified</strong> 0 if there are no modiﬁed ﬁles in the working copy 
directory; 1 or 2 if there are modiﬁed ﬁles. In general you 
don’t need this macro.</li>
</ul>

<p>These macros can be called wherever appropriate. I wanted my version control information discretely tucked away in a footer:</p>

<pre><code>\usepackage{fancyhdr}
\lfoot{\tiny{Revision: \VCRevision ; Author: \VCAuthor ; Date: \VCDateISO}}
\cfoot{}
\rfoot{}
</code></pre>

<p>The result:</p>

<p><img src="http://markelikalderon.com/wp-content/uploads/2008/03/vc-output.png" alt="vc output" /></p>

<p>If you want the version control information in draft mode only, Stephan Hennig, vc bundle&#8217;s maintainer, suggests using the <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/ifdraft.html" title="The TeX Catalogue OnLine, Entry for ifdraft, Ctan Edition">ifdraft</a> package.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2008/03/23/running-vc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Emacs Mode</title>
		<link>http://markelikalderon.com/2007/12/30/bash-emacs-mode/</link>
		<comments>http://markelikalderon.com/2007/12/30/bash-emacs-mode/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 15:18:46 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2007/12/30/bash-emacs-mode/</guid>
		<description><![CDATA[Navigating the command line on Apple&#8217;s terminal can be frustrating. The arrow keys only allow you to move one character at a time. So if you have typed a long command, say: $ perl texWordCount.pl /Users/markkalderon/Documents/TheHub/Research/Metamerism/Drafts/metamerism.tex and you realize you have forgotten an option, in this case -T: $ perl -T texWordCount.pl /Users/markkalderon/Documents/TheHub/Research/Metamerism/Drafts/metamerism.tex it can [...]]]></description>
			<content:encoded><![CDATA[<p>Navigating the command line on Apple&#8217;s terminal can be frustrating. The arrow keys only allow you to move one character at a time. So if you have typed a long command, say:</p>

<pre><code>$ perl texWordCount.pl /Users/markkalderon/Documents/TheHub/Research/Metamerism/Drafts/metamerism.tex
</code></pre>

<p>and you realize you have forgotten an option, in this case -T:</p>

<pre><code>$ perl -T texWordCount.pl /Users/markkalderon/Documents/TheHub/Research/Metamerism/Drafts/metamerism.tex
</code></pre>

<p>it can be tedious to move to the beginning of the line, character by character, to insert it. Fortunately, bash, the default shell on OS X, has an <a href="http://www.gnu.org/software/emacs/" title="GNU Emacs - GNU Project - Free Software Foundation
(FSF)">emacs</a> mode allowing you to use a subset of emacs commands on the command line. Emacs uses two modifier keys&#8212;control and meta. On OS X control is &#x2303; and meta is &#x238B;.</p>

<table>
<thead>
<tr>
  <th align="left">Command</th>
  <th align="left">Action</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="left">ctrl-a</td>
  <td align="left">Move cursor to beginning of line</td>
</tr>
<tr>
  <td align="left">ctrl-e</td>
  <td align="left">Move cursor to end of line</td>
</tr>
<tr>
  <td align="left">meta-b</td>
  <td align="left">Move cursor back one word</td>
</tr>
<tr>
  <td align="left">meta-f</td>
  <td align="left">Move cursor forward one word</td>
</tr>
<tr>
  <td align="left">ctrl-w</td>
  <td align="left">Cut the last word</td>
</tr>
<tr>
  <td align="left">ctrl-u</td>
  <td align="left">Cut everything before the cursor</td>
</tr>
<tr>
  <td align="left">ctrl-k</td>
  <td align="left">Cut everything after the cursor</td>
</tr>
<tr>
  <td align="left">ctrl-y</td>
  <td align="left">Paste the last thing to be cut</td>
</tr>
<tr>
  <td align="left">ctrl-_</td>
  <td align="left">Undo</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2007/12/30/bash-emacs-mode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Full Paths and the Multiline Shell Prompt</title>
		<link>http://markelikalderon.com/2007/11/24/full-paths-and-the-multiline-shell-prompt/</link>
		<comments>http://markelikalderon.com/2007/11/24/full-paths-and-the-multiline-shell-prompt/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 21:41:49 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2007/11/24/full-paths-and-the-multiline-shell-prompt/</guid>
		<description><![CDATA[The shell prompt in bash can be modified to provide useful information. There are environmental variables that can be set to control the prompt string (see the bash manpage for more information). One of the more useful things, in my opinion, to include in the prompt string is the current path (so you always knows [...]]]></description>
			<content:encoded><![CDATA[<p>The shell prompt in bash can be modified to provide useful information. There are environmental variables that can be set to control the prompt string (see the <a href="http://linux.die.net/man/1/bash">bash manpage</a> for more information). One of the more useful things, in my opinion, to include in the prompt string is the current path (so you always knows where you are without having to run pwd). The paths for deeply nested subdirectories can get quite long, however, leaving precious little space for commands. (Bash will wrap these, of course, but, still, annoying.) <a href="http://www.leancrew.com/all-this/2007/11/shell_game_with_zsh.html">Dr. Drang</a> details a solution in zsh that allows right-justified strings that can be overwritten. zsh is cool and all, but if you are not prepared to abandon bash (the default shell on OS X), you might try a multiline prompt. I have the following in my .profile:</p>

<pre><code>PS1="\n\
\$PWD\n\
$BOLD\h-\u$DIM $ "; export PS1
PS2="more=&gt; "; export PS2
</code></pre>

<p>Which produces the following shell prompt:</p>

<p><img src="http://markelikalderon.com/wp-content/uploads/2007/11/prompt.jpg" alt="Prompt" /></p>

<p>How apt a solution this is will depend, of course, on how precious vertical space in the terminal is to you. (Dr. Drang mentioned something about his left eye twitching uncontrollably.) So your mileage may vary.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2007/11/24/full-paths-and-the-multiline-shell-prompt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LaTeX, Relative Paths, and Structured Directories</title>
		<link>http://markelikalderon.com/2007/11/21/latex-relative-paths-and-structured-directories/</link>
		<comments>http://markelikalderon.com/2007/11/21/latex-relative-paths-and-structured-directories/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 03:26:17 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Markup]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2007/11/21/latex-relative-paths-and-structured-directories/</guid>
		<description><![CDATA[*nix operating systems use the following shorthand: . denotes the present directory and .. denotes the parent directory. Names for directories can be conjoined with a /. So ../.. denotes the second directory up from the present directory. You can go down the hierarchy as well as up. Suppose the present directory is foo and [...]]]></description>
			<content:encoded><![CDATA[<p>*nix operating systems use the following shorthand: . denotes the present directory and .. denotes the parent directory. Names for directories can be conjoined with a /. So ../.. denotes the second directory up from the present directory. You can go down the hierarchy as well as up. Suppose the present directory is foo and bar is a sibling of the present directory:</p>

<pre><code>|-- root/
    |-- foo/ (the present directory)
    |-- bar/
</code></pre>

<p>then ../bar/ would be the relative path for bar from foo (../ takes you up to root and bar/ takes you down to bar).</p>

<p>UNIX 101, I know, but what I did not know until just recently is that LaTeX accepts *nix relative paths. Which is awesome. That means complex LaTeX projects can live in a structured directory with, say, subdirectories for graphics. Suppose you are writing an article with graphics, your directory could be laid out as follows:</p>

<pre><code>|-- mylatexproject/
    |-- tex/
        |-- article.tex
    |-- graphics/
        |-- mygraphic.jpg
</code></pre>

<p>To insert mygraphic.jpg in article.tex you could then use:</p>

<pre><code>\insertgraphic{../graphics/mygraphic.jpg}
</code></pre>

<p>I plan to start work on my next book this summer. I am <em>so</em> glad that I sussed this out before then.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2007/11/21/latex-relative-paths-and-structured-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATPM on Activity Monitor</title>
		<link>http://markelikalderon.com/2006/11/02/atpm-on-activity-monitor/</link>
		<comments>http://markelikalderon.com/2006/11/02/atpm-on-activity-monitor/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 02:34:03 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[Activity Monitor]]></category>
		<category><![CDATA[FileMerge]]></category>
		<category><![CDATA[Hybrid Application]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Outliner]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2006/11/02/atpm-on-activity-monitor/</guid>
		<description><![CDATA[As I mentioned in my initial post, learning about the UNIX underpinnings of OS X was a revelation. While I would never like to work exclusively in a text based terminal, a lot of UNIX utilities can be exploited by writers as well as coders. While visual editing familiar from word processors tends to obscure [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my initial <a href="http://markelikalderon.com/blog/2006/09/27/the-word/">post</a>, learning about the UNIX underpinnings of OS X was a revelation. While I would never like to work <em>exclusively</em> in a text based terminal, a lot of UNIX utilities can be exploited by writers as well as coders. While visual editing familiar from word processors tends to obscure the semantic structure of complex documents, the GUI has its place even in the manipulation of text. There is an interesting class of applications that I like to think of as hybrid apps. The least interesting of these are merely GUI wrappers of command line utilities. Others, however, add value to these utilities by allowing the user to interact with them in novel and useful ways. One example that deserves special mention is Apple&#8217;s FileMerge that allows for the visual comparison of text files. I will be blogging more about FileMerge, but for now, here is a screenshot:</p>

<p><a class="imagelink" href="http://markelikalderon.com/wp-content/uploads/2006/11/Picture 1.png" title="FileMerge"><img id="image89" src="http://markelikalderon.com/wp-content/uploads/2006/11/Picture 1.thumbnail.png" alt="FileMerge" /></a></p>

<p>Another hybrid application from Apple is Activity Monitor:</p>

<p><a class="imagelink" href="http://markelikalderon.com/wp-content/uploads/2006/11/Picture 2.png" title="Activity Monitor"><img id="image90" src="http://markelikalderon.com/wp-content/uploads/2006/11/Picture 2.thumbnail.png" alt="Activity Monitor" /></a></p>

<p>Of course a lot of the information displayed by Activity Monitor can be accessed by top in the terminal, but there&#8217;s more besides. In a <em>How To</em> article in <a href="http://www.atpm.com/">About This Particular MacIntosh</a> Sylester Roque begins the first part of a <a href="http://www.atpm.com/12.11/activity.shtml">review</a> of the Activity Monitor. Check it out to get a sense of the potential of this underappreciated utility.</p>

<p>While on the topic of <a href="http://www.atpm.com/">ATPM</a>, Ted Goranson in his <a href="http://www.atpm.com/12.11/atpo.shtml">column</a> about outliners (text editors that allow multiple views of a document based on its logical structure), will be writing about writing environments next month. If you are not yet familiar with this fascinating column, the <a href="http://www.atpm.com/Back/atpo.shtml">archives</a> are a rewarding read.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2006/11/02/atpm-on-activity-monitor/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>In the Beginning Was the Word</title>
		<link>http://markelikalderon.com/2006/09/27/the-word/</link>
		<comments>http://markelikalderon.com/2006/09/27/the-word/#comments</comments>
		<pubDate>Wed, 27 Sep 2006 16:45:30 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2006/09/27/the-word/</guid>
		<description><![CDATA[One of the unexpected benefits of OS X was my rediscovery of UNIX. Prior to that, I had dim memories of a rarely used UNIX account when I was in college in the mid-eighties. The GUI of the newly installed Macs in some of the computer labs was a welcome relief from what I regarded [...]]]></description>
			<content:encoded><![CDATA[<p>One of the unexpected benefits of OS X was my rediscovery of UNIX. Prior to that, I had dim memories of a rarely used UNIX account when I was in college in the mid-eighties. The GUI of the newly installed Macs in some of the computer labs was a welcome relief from what I regarded as the obscure incantations of the command line. Word processing in a GUI environment seemed a genuine advance in the technology of writing, and I was hooked.</p>

<p>I was also wrong.</p>

<p>While I would never go back to working entirely in a terminal, I now understand that the ascendancy of the GUI represents the triumph of the Image over the Word. The visual editing of word processing provided merely the illusion of control and was, in fact, inimical to writing.</p>

<p>In exploring the UNIX underpinnings of OS X, I was pleased to discover that a lot of tools that programmers use are, in fact, readily adaptable to the task of writing.</p>

<p>In dumping word processing for something better, I received a lot of help from people sharing their knowledge online. As thanks and a small token of respect, I will be posting some of what I have learned here.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2006/09/27/the-word/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

