From owner-freebsd-stable@FreeBSD.ORG Mon Feb 28 17:30:11 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A4F31065670 for ; Mon, 28 Feb 2011 17:30:11 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id EF8768FC14 for ; Mon, 28 Feb 2011 17:30:10 +0000 (UTC) Received: from [128.206.184.213] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.4/8.14.4) with ESMTP id p1SHFdFK095832 for ; Mon, 28 Feb 2011 11:15:39 -0600 (CST) (envelope-from stephen@missouri.edu) Message-ID: <4D6BD83B.3040609@missouri.edu> Date: Mon, 28 Feb 2011 11:15:39 -0600 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.16) Gecko/20101225 SeaMonkey/2.0.11 MIME-Version: 1.0 To: FreeBSD Stable Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Change in behavior to stat(1) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 17:30:11 -0000 I had a little script that would remove broken links. I used to do it like this: if ! stat -L $link > /dev/null; then rm $link; fi But recently (some time in February according to the CVS records) stat was changed so that stat -L would use lstat(2) if the link is broken. So I had to change it to if stat -L $link | awk '{print $3}' | grep l > /dev/null; then rm $link; fi but it is a lot less elegant. What is the proper accepted way to remove broken links? Stephen