This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cd to directory in paste buffer : shell function


Hi,

I often want to cd to a (DOS) path that I've copied from some Windows App.

The following function (put in one of your startup files .bashrc .profile etc)  saves a few clicks
and is forward or backslash proof

function cdp() 
{
# cdp(aste)
# description : Cd to path in paste buffer: convert from DOS if required
# set -x
getclip
echo ''
getclip|sed 's#\\#\/#g'|putclip
cd $(getclip)
}

I can already see a few improvements, and it would also be nice to have a check that paste buffer
actually contains a path


-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]