From owner-freebsd-questions@FreeBSD.ORG Tue Jun 19 14:20:04 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CA41065670 for ; Tue, 19 Jun 2012 14:20:04 +0000 (UTC) (envelope-from fred.morcos@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id D3BAD8FC1D for ; Tue, 19 Jun 2012 14:20:03 +0000 (UTC) Received: by obcni5 with SMTP id ni5so385272obc.13 for ; Tue, 19 Jun 2012 07:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=s2Vxn2H+HTrbkRRdy9jNoLaDJqOfxStNDm15+3fLv98=; b=EQdKDYk1owPgk1BKxG3/GCeswFSPKU1GYHG0XcsoPJkWZXpVMaO72grDKzEwpkIew9 9UAytb1KA11yZo2BmKTu8UIrkIK3L8URUcfincXpX7q1qb9Q6nv6UfFkjlfQs8dpNSuy gNO3cJZIJFGDMYMi5bEl/xjBD7eBALCSMkQp48+60Mctsr477PyEy1+SQK7lNB294jQJ /lnXYV/PGykmmWbGiM1RoXFAhl4OBcPfQVLwDTGAsIkQkzHjhH+ImRkWct9sT51tWxlH vQ2LPd56cu7TQ7sw5jNhTw05HWqijPArWcH1K4eZDa6Sj/bJYljjxn/Y8FU4RJ8D97An PNoQ== Received: by 10.182.164.102 with SMTP id yp6mr19818029obb.66.1340115602863; Tue, 19 Jun 2012 07:20:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.241.7 with HTTP; Tue, 19 Jun 2012 07:19:42 -0700 (PDT) In-Reply-To: <4FE089AE.5050206@my.gd> References: <4FE08093.1040607@my.gd> <4FE089AE.5050206@my.gd> From: Fred Morcos Date: Tue, 19 Jun 2012 16:19:42 +0200 Message-ID: To: Damien Fleuriot Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: questions@freebsd.org Subject: Re: rm returns 0 although directory didn't exist and wasn't deleted ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 14:20:04 -0000 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 or modify the exit status to reflect an error. The -f option overrides any previous -i options. [1] http://www.freebsd.org/cgi/man.cgi?query=3Drm&apropos=3D0&sektion=3D0&m= anpath=3DFreeBSD+9.0-RELEASE&arch=3Ddefault&format=3Dhtml On Tue, Jun 19, 2012 at 4:16 PM, Damien Fleuriot wrote: > 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). >> >> 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 file or directory >>> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # rm -Rf >>> /var/tmp/stunnel/ >>> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # echo $? >>> 0 >>> >>> >>> >>> Anyone knows if that's intended ? >>> >>> FreeBSD pf2.[snip].com 8.3-STABLE FreeBSD 8.3-STABLE #0: Tue Jun 19 >>> 10:45:31 CEST 2012 >>> >>> _______________________________________________ >>> freebsd-questions@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd= .org"