<div>Can you take and sec and explain what this is doing.</div>
<div> </div>
<div>I dont see any ref to the ced func you wrote earlier.<br><br></div>
<div class="gmail_quote">On Wed, Sep 22, 2010 at 2:09 PM, Richard Bronosky <span dir="ltr"><<a href="mailto:Richard@bronosky.com">Richard@bronosky.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">However, if you insist on making a cd replacement with that interface,<br>simplify it down to:<br>
<div class="im">function cd () {<br>if [ -n "$2" ] ; then<br></div> builtin cd "${PWD/foo/bar}"<br>else<br> builtin cd "$@"<br>fi<br>}<br><br>BTW, quoting is important! Directory names do often have spaces. So,<br>
my previous reply should have been:<br>
<div class="im">function ced () { nd="$(pwd | sed "$@")" && cd "$nd"; }<br><br></div>
<div class="im">>> function cd () {<br>>> if [ -n "$2" ] ; then<br>>> nd=`pwd | sed 's/'$1'/'$2'/'`<br>>> builtin cd $nd<br>>> else<br>>> builtin cd $1<br>
>> fi<br>>> }<br>>><br>>> bash$ cd /usr/lib/<br>>> bash$ pwd<br>>> /usr/lib<br>>> bash$ cd usr var<br>>> bash$ pwd<br>>> /var/lib<br><br></div><font color="#888888">--<br>
.!# RichardBronosky #!.<br></font>
<div>
<div></div>
<div class="h5"><br>_______________________________________________<br>Ale mailing list<br><a href="mailto:Ale@ale.org">Ale@ale.org</a><br><a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br><a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br></div></div></blockquote></div><br>