Re: pwd-problem
On Wed, Aug 08, 2001 at 10:35:10AM -0400, Richard Ramos wrote: >Let me take this opportunity to describe some pwd-related behavior that >I thought was unexpected. Maybe we can hash out the whole "pwd" question. > >My not-so-informed opinion is that the behavior you see is what I would >have expected since the command would have executed in you current >directory. pwd prints the current working directory. If you cd to /, pwd will print /. I really don't understand how anyone could consider this to be a bug. >I put together a script to illustrate the unexpected behavior I see: > >$cat testscr >#! /bin/sh > >echo \$PWD=$PWD >echo cd .. >cd ..; echo pwd produces: `pwd` >echo \$PWD = $PWD > >The output of the script is as follows: > >$ tstscr >$PWD=/home/rramos >cd .. >pwd produces: /home >$PWD = /home/rramos > >The pwd command seems to produce the result I would have expected >(the directory changes according to the script) but the PWD variable stays >fixed at the directory where I ran the script from. I thought the PWD >variable should have followed along. The PWD variable is not used by ash. If you want PWD to change use bash. cgf -- 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/
Re: pwd-problem
Let me take this opportunity to describe some pwd-related behavior that I thought was unexpected. Maybe we can hash out the whole "pwd" question. My not-so-informed opinion is that the behavior you see is what I would have expected since the command would have executed in you current directory. I put together a script to illustrate the unexpected behavior I see: $cat testscr #! /bin/sh echo \$PWD=$PWD echo cd .. cd ..; echo pwd produces: `pwd` echo \$PWD = $PWD The output of the script is as follows: $ tstscr $PWD=/home/rramos cd .. pwd produces: /home $PWD = /home/rramos The pwd command seems to produce the result I would have expected (the directory changes according to the script) but the PWD variable stays fixed at the directory where I ran the script from. I thought the PWD variable should have followed along. Rich Peter Feldbaumer wrote: > Hi! > > I'm new to this mailing-list, so please excuse if I ask questions that > aren't that new to you. > I tried to search the archives concerning pwd-problems, and found that there > have already been some discussions concerning the paths pwd (or /bin/pwd) is > returning. > > I'm having the problem, that pwd always returns the path where you typed in > your last command. > This breaks a few makefiles if they are located in subdirectories, since > they use "$(shell pwd)" to get their "TOPDIR". > And since pwd doesn't return the path the makefile is in, but rather the > path you typed "make -C subdir" in, they don't get their "TOPDIR" right. > > First I thought that this was a problem only concerning "make", but some > tests prooved that this seems to be a general problem with "pwd". > > If you have a short shell-script > > #!/bin/sh > pwd > > saved as /tmp/print_pwd, and then go to your root dir and type > > tmp/print_pwd > > the output of print_pwd will be > > / > > and not > > /tmp > > as I would expect. > > Please correct me, but I don't think that this is the expected behaviour of > "pwd". > Right now I'm using the snaptshot of Aug.7th 2001 on Win98, but this "bug" > (feature?) was already present in the snapshots before. > > If I'm wrong about this, please could you point out ANY way that I can get > pwd to print the "current" directory, since I tried already numerous > versions (cd tmp && pwd ) and they all deliver the same result! > > Best regards, > Peter Feldbaumer > -- > FeldTech.com - Software Engineering & System Solutions > Goestingerstraße 72, 8051 Graz, Austria > Tel.: +43/316/584530 - Fax.: +43/316/584930 > http://www.feldtech.com - mailto:[EMAIL PROTECTED] > > -- > 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/ begin:vcard n:Ramos;Richard tel;work:732-380-2846 x-mozilla-html:FALSE org:Coree Networks adr:;;56 Park Road;Tinton Falls;NJ;07724; version:2.1 email;internet:[EMAIL PROTECTED] title:Software Engineer fn:Richard Ramos end:vcard -- 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/
RE: pwd-problem
> From: Peter Feldbaumer [mailto:[EMAIL PROTECTED]] > Subject: pwd-problem > I'm having the problem, that pwd always returns the path > where you typed in your last command. >... > If you have a short shell-script > > #!/bin/sh > pwd > > saved as /tmp/print_pwd, and then go to your root dir and type >tmp/print_pwd > the output of print_pwd will be > / > and not > /tmp > as I would expect. > > Please correct me, but I don't think that this is the > expected behaviour of "pwd". It is the expected behaviour. > Right now I'm using the snaptshot of Aug.7th 2001 on Win98, > but this "bug" > (feature?) was already present in the snapshots before. This is not a Cygwin issue. All unix-based systems behave this way. > > If I'm wrong about this, please could you point out ANY way > that I can get > pwd to print the "current" directory, since I tried already numerous > versions (cd tmp && pwd ) and they all deliver the same result! You seem to have a strange idea of "current" directory. Would "dirname" do what you want? -- 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/
Re: pwd problem with GNU make
On Sun, Dec 24, 2000 at 02:31:16PM -0500, Christopher Faylor wrote: >On Thu, Dec 21, 2000 at 01:31:55PM -0800, Richard Y. Kim wrote: >> >>I have updated all my cygwin packages as of >>13:00 PST on December 21, 2000 from freesoftware.com. >> >>It seems like GNU make gets confused about the current working >>directory (indicated by the fact that included files are not found) >>when I cd into a directory using a drive letter and a trailing /. For >>example running "make" works fine after cd'ing using "/tmp", "/tmp/", >>or "c:/p/cygwin/tmp". However GNU make gets confused when >>"c:/p/cygwin/tmp/" is used with a trailing slash. >> >>I reported a similar problem with pwd in cygwin a few weeks ago >>which was followed by a flurry of discussion on getcwd() function. >> >>http://sources.redhat.com/ml/cygwin/2000-11/msg00590.html > >Sorry. This discussion has nothing to do with getcwd that I can see. Just to clarify, by "this discussion" I meant the URL that you are referring to. cgf -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple
Re: pwd problem with GNU make
On Thu, Dec 21, 2000 at 01:31:55PM -0800, Richard Y. Kim wrote: > >I have updated all my cygwin packages as of >13:00 PST on December 21, 2000 from freesoftware.com. > >It seems like GNU make gets confused about the current working >directory (indicated by the fact that included files are not found) >when I cd into a directory using a drive letter and a trailing /. For >example running "make" works fine after cd'ing using "/tmp", "/tmp/", >or "c:/p/cygwin/tmp". However GNU make gets confused when >"c:/p/cygwin/tmp/" is used with a trailing slash. > >I reported a similar problem with pwd in cygwin a few weeks ago >which was followed by a flurry of discussion on getcwd() function. > >http://sources.redhat.com/ml/cygwin/2000-11/msg00590.html Sorry. This discussion has nothing to do with getcwd that I can see. cgf -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple
