Re: rm returns 0 although directory didn't exist and wasn't deleted ?

2012-06-19 Thread Robert Bonomi
Damien Fleuriot wrote: > > I've stumbled upon this *so weird* behaviour. > > # ls -la /var/tmp/stunnel/ > ls: /var/tmp/stunnel/: No such file or directory > # rm -Rf /var/tmp/stunnel/ > # echo $? > 0 > > Anyone knows if that's intended ? yes. ___ fre

Re: rm returns 0 although directory didn't exist and wasn't deleted ?

2012-06-19 Thread Fred Morcos
The man page [1] explicitly states that if the file doesn't exist, -f will not show an error message nor alter the exit code. -f Attempt to remove the files without prompting for confirmation, regardless of the file's permissions. If the file does not exist, do not display a diagnostic message

Re: rm returns 0 although directory didn't exist and wasn't deleted ?

2012-06-19 Thread Damien Fleuriot
I always assumed -f would only force removal, not modify the exit code. No bug then, working as intended, all good. Cheers On 6/19/12 3:43 PM, Fred Morcos wrote: > You used -f which means rm will not complain if a file or directory > cannot be deleted (or does not exist in the first place). >

Re: rm returns 0 although directory didn't exist and wasn't deleted ?

2012-06-19 Thread Fred Morcos
You used -f which means rm will not complain if a file or directory cannot be deleted (or does not exist in the first place). On Tue, Jun 19, 2012 at 3:37 PM, Damien Fleuriot wrote: > I've stumbled upon this *so weird* behaviour. > > > > # ls -la /var/tmp/stunnel/ > ls: /var/tmp/stunnel/: No such

Re: rm returns 0 although directory didn't exist and wasn't deleted ?

2012-06-19 Thread Grzegorz Blach
On 06/19/2012 03:37 PM, Damien Fleuriot wrote: I've stumbled upon this *so weird* behaviour. # ls -la /var/tmp/stunnel/ ls: /var/tmp/stunnel/: No such file or directory # rm -Rf /var/tmp/stunnel/

rm returns 0 although directory didn't exist and wasn't deleted ?

2012-06-19 Thread Damien Fleuriot
I've stumbled upon this *so weird* behaviour. # ls -la /var/tmp/stunnel/ ls: /var/tmp/stunnel/: No such file or directory # rm -Rf /var/tmp/stunnel/ # echo $? 0 Anyo