Hi Eric. On 02/16/2012 04:28 PM, Eric Blake wrote: > > You can always use 'rm -rf dummy $file_list' without having to check for > whether $file_list is empty, but yes, that is the primary reasoning why > -f with no options behaves differently than any other case with no options. > > FYI: I just opened a POSIX bug report, asking that this usage be > codified (since everyone that I tested already does it): > http://austingroupbugs.net/view.php?id=542 > Still, I vaguely recall that there are some 'rm' implementations out there which fails upon "rm -f" (with no arguments); and that's why automake uses the ugly idiom:
test -z "$(VAR)" || rm -f $(VAR) in a lot of recipes. Now, I can't tell off-hand which systems those were, nor if they actually exist (and in fact I'd *love* to be proven wrong here, so that we could simplify a bunch of automake recipes); but a more extensive probing is needed in this matter I guess. And if you are right (as I hope), then this 'rm' feature could be documented in the Autoconf manual. Regards, Stefano