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.

Full log


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






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

Previous Next


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