This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Bash puzzle: Spaces, environment variables and tab completion
- From: "Ehud Karni" <ehud at unix dot mvs dot co dot il>
- To: "James Shaw" <qumqam at yahoo dot com>
- Cc: "Gary R. Van Sickle" <g dot r dot vansickle at worldnet dot att dot net>, " Unix on M$Win" <cygwin at cygwin dot com>
- Date: Thu, 5 Dec 2002 17:20:03 +0200
- Subject: Re: Bash puzzle: Spaces, environment variables and tab completion
- Organization: Mivtach-Simon Insurance agencies
- References: <20021205060104.39630.qmail@web13602.mail.yahoo.com>
- Reply-to: ehud at unix dot mvs dot co dot il
On Wed, 4 Dec 2002 22:01:04 -0800 (PST), James Shaw <qumqam@yahoo.com> wrote:
>
> One minus with this 'cheat' is that I don't get
> the 'real' name of the path. E.g. If I cd ~/pf,
> bash (correctly) thinks that I'm in /home/jhs/pf,
> but it would be nice to use the long name. If it
> was a hard link, neither link would be the "real"
> name, but with a symlink, there is some sense of
> "real" and "virtual". So, if anyone has a fix for
> this minor glitch, I'd appreciate comments.
You can create a function to achieve your desire:
cd ()
{
builtin cd "$1"
builtin cd `pwd -P`
}
To test it interactively, you have to do the definition like this
function cd () { builtin cd $1 ; builtin cd `pwd -P` ; }
Now, whenever you'll cd to a directory it will translate the full
directory path to its real (cygwin's) path without any symlinks.
Note. This will work with the symlink work around, NOT with the
mount one (because mount is new REAL name).
Note to Gary - this is the bash/UNIX way, you don't have to use
cygwin's unique tools (like cygpath).
Ehud.
--
Ehud Karni Tel: +972-3-7966-561 /"\
Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign
Insurance agencies (USA) voice mail and X Against HTML Mail
http://www.mvs.co.il FAX: 1-815-5509341 / \
mailto:ehud@unix.mvs.co.il Better Safe Than Sorry
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/