From owner-freebsd-questions@FreeBSD.ORG Tue Jan 29 03:21:03 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ED381C69 for ; Tue, 29 Jan 2013 03:21:03 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) Received: from nm2-vm0.bullet.mail.ird.yahoo.com (nm2-vm0.bullet.mail.ird.yahoo.com [77.238.189.199]) by mx1.freebsd.org (Postfix) with SMTP id 4A9151AD for ; Tue, 29 Jan 2013 03:21:02 +0000 (UTC) Received: from [77.238.189.56] by nm2.bullet.mail.ird.yahoo.com with NNFMP; 29 Jan 2013 03:20:56 -0000 Received: from [46.228.39.121] by tm9.bullet.mail.ird.yahoo.com with NNFMP; 29 Jan 2013 03:20:56 -0000 Received: from [127.0.0.1] by smtp158.mail.ir2.yahoo.com with NNFMP; 29 Jan 2013 03:20:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s1024; t=1359429656; bh=7ai2jSxzAZuc1hH0+4I4KUjyhETprrF7isJARwK7UNU=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Content-Type:To:Subject:References:Date:MIME-Version:Content-Transfer-Encoding:From:Message-ID:In-Reply-To:User-Agent; b=Xs1Uj3/4isrpBqBIoKBkw84I0Q04XqrRrSsjCWdtECcgpb2zzGUYBbVYFWg4Kdf7UQon1W2U904Ren4bR0k6/1x3JrJR8OG7GYgr0Au+TiKh3fZyzL/+DkO2JpEXhswpqAwE7bkPYMfjwT9UzzD81InicOasKewzZwlj0jBAJTw= X-Yahoo-Newman-Id: 185898.54497.bm@smtp158.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ReQZtkcVM1mgJOmPmJefSXQ0ituEtv2x5ESVqKGwS3hIUMJ TYy1TM2TKqwZzgVn8nduZgpNUG.m3h2Jbm6Vhz8HP_U4rZSK0oliZyOXpMsp ._4jU0aLer_E_XsqtIplcoAs7Jl6aFc1ib_5vWwhAqQL.AovQHsDnop.6foP TX2j3R4tzjMA63pxaZJK8xLAPT1Tt8AiV1TIgsc.zTQ9dwjJDRsqxBAxlB2H J5Ka1OEDcO9Qpd5lsAvRibTiS.X_otAceGB7rDmnaFI6Okyyas5wubVEqPrd pFsr7CUc9JVQknyOhtnoCo7PzBVek9e8FzHleY7ll67boAcveU6I7xPuzEBN zV9Cy_7O.vdH97iU5YkdAq8dRlo7c9Pyxvb9HNOZ_r.PnyHp.A_2n2Mc5A.n e9M_4_kEmouc0QX3u.LOzcy.gsC3elyyxrXgGcg-- X-Yahoo-SMTP: BeMCPs2swBABTJ3kAeEiC_hE0mz8jRexLddJfD8pI2j32fOacjBmXg-- Received: from freebsd (ralf.mardorf@92.224.211.22 with login) by smtp158.mail.ir2.yahoo.com with SMTP; 29 Jan 2013 03:20:56 +0000 UTC Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: freebsd-questions@freebsd.org Subject: Re: How to fix a broken owner for files from world & build from ports? References: <20130128182726.42db0712.freebsd@edvax.de> <510736DE.4060701@gmail.com> <51073C35.8010602@gmail.com> Date: Tue, 29 Jan 2013 04:20:55 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ralf Mardorf" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.12 (FreeBSD) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 03:21:04 -0000 On Tue, 29 Jan 2013 04:19:08 +0100, Ralf Mardorf wrote: > On Tue, 29 Jan 2013 04:15:17 +0100, Ralf Mardorf > wrote: > >> On Tue, 29 Jan 2013 04:04:21 +0100, Joshua Isom >> wrote: >> >>> On 1/28/2013 8:54 PM, Ralf Mardorf wrote: >>>> On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom >>>> wrote: >>>>> On 1/28/2013 7:56 PM, Ralf Mardorf wrote: >>>>>> Still not perfect, I guess I need something similar to ls -RAl for >>>>>> some >>>>>> directories :S and I didn't test what awk will do with names >>>>>> including a >>>>>> space. >>>>> >>>>> Try `find /dir -ls`. You can pipe it into sed like this `find /dir >>>>> -ls| sed -e 's%/dir%%g'` and then get something easily comparable. >>>> >>>> Cool, it does display the path, but there's still the other issue: >>>> >>>> $ touch test\ test >>>> $ find * -ls| sed -e 's%/dir%%g'| awk '{print $5" "$11}' >>>> rocketmouse test >>>> >>>> Perhaps awk isn't that important, but it e.g. will filter different >>>> file >>>> sizes, for e.g. configurations I edited in the meantime. >>>> >>>> :( >>> >>> You're basically getting down to the dirty tedious parts. Unless you >>> know a full featured scripting language with a find library to find >>> and compare ownership, or you want a custom c program for a rare >>> occurrence, you're just going to have to do it the tedious way. >>> Computer's aren't always fun and glory. For every beautiful network, >>> someone had to run the wires into the wall, through the dirt, and to >>> the other building. >> >> I already have an idea. Since $11 is the last output I might be able to >> check whether there is a space followed by a sign, by a loop, assumed >> there should be several spaces, interrupted by signs. I guess to care >> for several spaces one after the other and exotic signs that might >> "break" awk IMO isn't needed. >> >> It might become a very long "command line" ;). Perhaps I don't need it, >> I have to test it. I extracted the first dump, but need a rest now. >> >> Thank you :). > > Solved! > > # find * -ls | sed -e 's%/dir%%g' | awk '{print $5" "$11" "$12" "$13}' > > I can add $14 to $83635484 ;). I guess $[...] is limited, but even with 12 and 13, it should be enough.