euglug.org

[Eug-lug] stupid bash question

작성자

카테고리:



Bob MillerTue Mar 15 09:42:56 PST 2005

Bob Miller wrote:

> function cdlast { cd `dirname $_`; }

Correction:

function cdlast { cd "`dirname \"$_\"`"; }

Now it works even if the path has spaces or other punctuation in it.
And it looks slightly less obvious. (-:

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     kbob at jogger-egg.com