bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-05 Thread Linda Walsh
Paul Eggert wrote: On 09/05/2012 07:51 AM, Linda A. Walsh wrote: Just start the script with "#!/bin/sh", as usual. When invoked that way, Bash and other shells are POSIX-compliant in this area. To what level of posix... To all the levels that are relevant for this discussion. I

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-05 Thread Paul Eggert
On 09/05/2012 07:51 AM, Linda A. Walsh wrote: >> Just start the script with "#!/bin/sh", as usual. >> When invoked that way, Bash and other shells are POSIX-compliant >> in this area. > To what level of posix... To all the levels that are relevant for this discussion. In practice, people use "#!

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-05 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 11:58 PM, Linda A. Walsh wrote: I'm not talking for interactive use... I'm talking for use in a script that might run on systems that are not mine -- so I can't rely on shell settings. Yes you can. Just start the script with "#!/bin/sh", as usual.

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-05 Thread Paul Eggert
On 09/04/2012 11:58 PM, Linda A. Walsh wrote: >I'm not talking for interactive use... I'm talking for use in a script > that might run on systems that are not mine -- so I can't rely on shell > settings. Yes you can. Just start the script with "#!/bin/sh", as usual. When invoked that way, Ba

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 06:55 PM, Linda A. Walsh wrote: So how do delete all files in the directory without wild cards? Why tie your hands behind your back? Use wild cards: cd DIRECTORY && rm -fr * .[!.] .??* If you do this a lot, put it into a shell script. It's not li

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Bernhard Voelker
On 09/05/2012 08:25 AM, Paul Eggert wrote: > On 09/04/2012 06:55 PM, Linda A. Walsh wrote: > >> So how do delete all files in the directory without wild cards? > > Why tie your hands behind your back? Use wild cards: > > cd DIRECTORY && rm -fr * .[!.] .??* > > If you do this a lot, put it i

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Paul Eggert
On 09/04/2012 06:55 PM, Linda A. Walsh wrote: > So how do delete all files in the directory without wild cards? Why tie your hands behind your back? Use wild cards: cd DIRECTORY && rm -fr * .[!.] .??* If you do this a lot, put it into a shell script. It's not like the need is all that commo

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 04:21 PM, Linda A. Walsh wrote:> Paul Eggert wrote: expecting it to do nothing useful other than issue an error? Sure. People might expect the utility to complain about what they consider to be obvious typos, rather than to remove files they don't exp

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Paul Eggert
On 09/04/2012 04:21 PM, Linda A. Walsh wrote:> Paul Eggert wrote: > expecting it to do nothing useful other than issue an error? Sure. People might expect the utility to complain about what they consider to be obvious typos, rather than to remove files they don't expect to be removed. For examp

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 10:46 AM, Linda A. Walsh wrote: I would assert that the trailing "." shouldn't be stripped either. If we were designing anew, I'd be inclined to agree with you. But there are probably people expecting the standard behavior now, i.e. expecting i

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Paul Eggert
On 09/04/2012 10:46 AM, Linda A. Walsh wrote: > I would assert that the trailing "." shouldn't be stripped either. If we were designing anew, I'd be inclined to agree with you. But there are probably people expecting the standard behavior now, and there's an argument for not departing from the sta

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Eric Blake
On 09/04/2012 11:46 AM, Linda A. Walsh wrote: > POSIX is portability standard -- it should not > be regarded as a restrictive standard, unless not doing so would hinder > portability. In effect, they are disallowing OS's to make extensions > beyond > what they allow in the newer standards... That

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Jim Meyering wrote: These commands would evoke an invalid diagnostic: $ mkdir d && ln -s d s && env rm -r s/ rm: cannot remove 's': Too many levels of symbolic links remove.c was stripping trailing slashes from "s/" before passing the name to "rm". But a trailing slash may change the sem