How to fix a broken owner for files from world & build from ports?

Ralf Mardorf ralf.mardorf at rocketmail.com
Tue Jan 29 03:19:12 UTC 2013


On Tue, 29 Jan 2013 04:15:17 +0100, Ralf Mardorf  
<ralf.mardorf at rocketmail.com> wrote:

> On Tue, 29 Jan 2013 04:04:21 +0100, Joshua Isom <jrisom at gmail.com> wrote:
>
>> On 1/28/2013 8:54 PM, Ralf Mardorf wrote:
>>> On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom <jrisom at gmail.com>  
>>> 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 ;).


More information about the freebsd-questions mailing list