bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20679: A bug of pwd


From: Bernhard Voelker
Subject: bug#20679: A bug of pwd
Date: Thu, 28 May 2015 09:32:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]