GNU bug report logs - #20679
A bug of pwd

Previous Next

Package: coreutils;

Reported by: 徐兴旺 <xuxingwang <at> gmail.com>

Date: Thu, 28 May 2015 04:10:04 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20679 in the body.
You can then email your comments to 20679 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#20679; Package coreutils. (Thu, 28 May 2015 04:10:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to 徐兴旺 <xuxingwang <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 28 May 2015 04:10:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 徐兴旺 <xuxingwang <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: A bug of pwd
Date: Thu, 28 May 2015 12:08:29 +0800
[Message part 1 (text/plain, inline)]
If the name of current diretory including blank, pwd return raw blank
istead of escaping character, "\ ".
When used with cp command, the directory name will be recognized two params.
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#20679; Package coreutils. (Thu, 28 May 2015 07:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 20679 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: 徐兴旺 <xuxingwang <at> gmail.com>, 
 20679 <at> debbugs.gnu.org
Subject: Re: bug#20679: A bug of pwd
Date: Thu, 28 May 2015 09:32:21 +0200
tag 20679 notabug
close 20679
stop

On 05/28/2015 06:08 AM, 徐兴旺 wrote:
> If the name of current diretory including blank, pwd return raw blank istead of escaping character, "\ ".
> When used with cp command, the directory name will be recognized two params.

If I understand correctly, then you have a script doing something like
the following:

  $ mkdir "a dir"
  $ cd "a dir"
  $ cp -v /dev/null $(pwd)
  cp: target ‘dir’ is not a directory

First of all, I want to mention that the invoked 'pwd' is a builtin
in most shells, which means you have to e.g. specify the path like
/bin/pwd to be sure to invoke the coreutils version of it.

Second, the output of pwd(1) is correct - i.e., there is no such
thing than escaping characters.  Instead, the caller has to care
about proper quoting:

  $ cp -v /dev/null "$(pwd)"
  ‘/dev/null’ -> ‘/tmp/a dir/null’

Therefore, I'm marking this as "not a bug" in our software.  But in case
of questions please don't hesitate to discuss this further by replying
to this bug.

Have a nice day,
Berny






Information forwarded to bug-coreutils <at> gnu.org:
bug#20679; Package coreutils. (Sun, 31 May 2015 02:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 20679 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: 20679 <at> debbugs.gnu.org
Cc: 徐兴旺 <xuxingwang <at> gmail.com>
Subject: Re: bug#20679: A bug of pwd
Date: Sat, 30 May 2015 20:35:37 -0600
Bernhard Voelker wrote:
> First of all, I want to mention that the invoked 'pwd' is a builtin
> in most shells, which means you have to e.g. specify the path like
> /bin/pwd to be sure to invoke the coreutils version of it.

A very, very small comment.  This is all true but the wording makes it
sound somewhat like a recommendation to use /bin/pwd in order to get
the coreutils program.  I don't think that was intended.  I think
instead it was intended only that normally the user has called the
builtin pwd and the builtin is not coreutils and therefore nothing we
would do about it here.  Reports about the builtin would go to the
shell.

One can compare the builtin by using both a plain "pwd" version and
comparing against the "/bin/pwd" coreutils version in order to test
differences between them.  If they work the same then it is very
unlikely it would be a bug since they are independent implementations.

For typical scripting it would be normal to continue to use the plain
"pwd" and use the shell builtin version.  But proper shell quoting is
still needed.  :-)

Bob




Information forwarded to bug-coreutils <at> gnu.org:
bug#20679; Package coreutils. (Sun, 31 May 2015 08:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 20679 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Bob Proulx <bob <at> proulx.com>, 20679 <at> debbugs.gnu.org
Cc: 徐兴旺 <xuxingwang <at> gmail.com>
Subject: Re: bug#20679: A bug of pwd
Date: Sun, 31 May 2015 10:15:44 +0200
On 05/31/2015 04:35 AM, Bob Proulx wrote:
> Bernhard Voelker wrote:
>> First of all, I want to mention that the invoked 'pwd' is a builtin
>> in most shells, which means you have to e.g. specify the path like
>> /bin/pwd to be sure to invoke the coreutils version of it.
> 
> A very, very small comment.  This is all true but the wording makes it
> sound somewhat like a recommendation to use /bin/pwd in order to get
> the coreutils program.  I don't think that was intended.  I think
> instead it was intended only that normally the user has called the
> builtin pwd and the builtin is not coreutils and therefore nothing we
> would do about it here.

Indeed, thanks for making that clearer.

Have a nice day,
Berny




Added tag(s) notabug. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 23 Oct 2018 02:24:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20679 <at> debbugs.gnu.org and 徐兴旺 <xuxingwang <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 23 Oct 2018 02:24:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Nov 2018 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.