<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Jerod Santo - Latest Comments in cd up, up, and a-up</title><link>http://blogt0sk1.disqus.com/</link><description>Ruby. JavaScript. Whathaveyou</description><atom:link href="https://blogt0sk1.disqus.com/cd_up_up_and_a_up/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 08 Sep 2009 17:03:44 -0000</lastBuildDate><item><title>Re: cd up, up, and a-up</title><link>http://jerodsanto.net/2009/09/cd-up-up-up/#comment-16212614</link><description>&lt;p&gt;So you're accessing a subset of $1. That makes sense.&lt;/p&gt;&lt;p&gt;Your function works great in every situation except when you don't pass any args to cd at all. In this case, it fails. I added a check for that case and updated the function in the post. Let me know if it can be further improved.&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jerod Santo</dc:creator><pubDate>Tue, 08 Sep 2009 17:03:44 -0000</pubDate></item><item><title>Re: cd up, up, and a-up</title><link>http://jerodsanto.net/2009/09/cd-up-up-up/#comment-16204200</link><description>&lt;p&gt;${foo:x:y} == foo[x:y] in Python.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">someguy</dc:creator><pubDate>Tue, 08 Sep 2009 14:10:39 -0000</pubDate></item><item><title>Re: cd up, up, and a-up</title><link>http://jerodsanto.net/2009/09/cd-up-up-up/#comment-16196478</link><description>&lt;p&gt;You're absolutely right, my function doesn't handle spaces in pathnames at all. I'll give yours a try and if it works as advertised I'll be using it instead, thanks!&lt;/p&gt;&lt;p&gt;I'm not familiar with:&lt;/p&gt;&lt;p&gt;${1:0:2}&lt;/p&gt;&lt;p&gt;What does that mean?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jerod Santo</dc:creator><pubDate>Tue, 08 Sep 2009 11:52:55 -0000</pubDate></item><item><title>Re: cd up, up, and a-up</title><link>http://jerodsanto.net/2009/09/cd-up-up-up/#comment-16188007</link><description>&lt;p&gt;This seems unnecessarily complicated. It's also not safe for pathnames with spaces or other shellcandy. Try:&lt;/p&gt;&lt;p&gt;function cd () {&lt;br&gt;    if [ ${1:0:2} == '..' ]; then&lt;br&gt;        rest=${1:2}&lt;br&gt;        rest=${rest//./../}&lt;br&gt;        builtin cd "${1:0:2}/${rest}"&lt;br&gt;    else&lt;br&gt;        builtin cd "$1";&lt;br&gt;    fi&lt;br&gt;}&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">someguy</dc:creator><pubDate>Tue, 08 Sep 2009 11:02:56 -0000</pubDate></item></channel></rss>