Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 10 Feb 2003 00:15:14 +0100 From: Mathias Gygax To: cygwin Subject: Re: cygwin symlink? bug Message-ID: <20030209231513.GA10083@zeus.eniac.ch.eu.org> Mail-Followup-To: cygwin References: <000901c2d022$869cbe80$0200a8c0 AT ufo> <5 DOT 2 DOT 0 DOT 9 DOT 2 DOT 20030209080135 DOT 02d48f88 AT pop3 DOT cris DOT com> <037701c2d083$5c3ed4f0$6b7c86d9 AT webdev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <037701c2d083$5c3ed4f0$6b7c86d9@webdev> User-Agent: Mutt/1.5.3i On Sun, Feb 09, 2003 at 09:30:17PM -0000, Elfyn McBratney wrote: hi you, > > BASH keeps an internal idea of the current working directory. In the > > face of symbolic links, this internal record of the current working > > directory may not be identical to that computed by the "pwd" programs > > traversal-to-root algorithm. > > > > I use this instead of BASH's built-in pwd command: > > > > wd() { > > WD="$(pwd)" > > WDP="$(/bin/pwd)" > > if [ "$WD" != "$WDP" ]; then > > echo "bash: $WD"$'\n'"real: $WDP" > > else > > echo "$WD" > > fi > > } > > > > I use this one if I want to see the Windows form of the current working > > directory, too: > > > > awd() { > > WD="$(pwd)" > > WDP="$(/bin/pwd)" > > if [ "$WD" != "$WDP" ]; then > > echo "bash: $WD"$'\n'"cyg: $WDP" > > else > > echo "cyg: $WD" > > fi > > echo "win: $(cygpath -w -a "$(pwd)")" > > echo "mix: $(cygpath -m -a "$(pwd)")" > > } > > > > Randall Schulz > > Thanks Randall, That's something new for my sandbox ;-) > > Ando sorry..meant to send to the list not a direct thing :::::::-) sorry for making some noise here, but the pwd bash-builtin does have a switch. start it with "pwd -P" and it will traverse symlinks and printout the real current working directory. pwd: pwd [-PL] Print the current working directory. With the -P option, pwd prints the physical directory, without any symbolic links; the -L option makes pwd follow symbolic links. HTH - regards, turrican -- 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/