linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Bussenius <busseniu@cip.physik.uni-muenchen.de>
To: linux-c-programming@vger.kernel.org
Cc: Linux C Programming <linux-c-programming@vger.kernel.org>
Subject: Re: stracing pwd
Date: Sat, 19 Jun 2004 18:13:02 +0200	[thread overview]
Message-ID: <20040619161302.GA31012@opaque> (raw)
In-Reply-To: <1087658980.8158.13.camel@mokona>

On Sat, Jun 19, 2004 at 10:29:40AM -0500, David Eduardo Gómez Noguera wrote:
> /usr/src/linux-2.6.7
> /usr/src/linux -> /usr/src/linux-2.6.7
> 
> under /usr/src/linux, 
> pwd prints /usr/src/linux
> pwd -L too
> pwd -P prints /usr/src/linux-2.6.7
> but an strace always shows the same
> write(1, "/usr/src/linux-2.6.7\n", 21/usr/src/linux-2.6.7
> )  = 21
> and it prints /usr/src/linux-2.6.7 to stdout no matter the parameter
> given to pwd.
> 
> Anyone knows why that could happen? 
> ( I haven't seen to the pwd code yet though)

The difference is that the first time you call pwd, you actually call
the shell builtin named pwd. The second time you call pwd, you call
/bin/pwd. The shell thinks you are where you have cd'd to, but in fact,
you are in /usr/src/linux-2.6.7. Just try typing /bin/pwd in the shell.

Cheers,
Christoph

-- 
``There's no dark side of the moon, really
Matter of fact, it's all dark''

--Pink Floyd
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2004-06-19 16:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-19 15:29 stracing pwd David Eduardo Gómez Noguera
2004-06-19 16:13 ` Christoph Bussenius [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040619161302.GA31012@opaque \
    --to=busseniu@cip.physik.uni-muenchen.de \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).