bug#20679: A bug of pwd
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
bug#20679: A bug of pwd
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
bug#20679: A bug of pwd
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
bug#20679: A bug of pwd
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.