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

2013-01-29 Thread parv
in message op.wrms0fqkqhadp0@freebsd,
wrote Ralf Mardorf thusly...

 Hi :)

 I hope it's ok, when I open a new thread for this issue.
 First I need to know what files have a bad owner.

 I'm running
 # freebsd-update IDS  outfile_28Jan2013.ids
 perhaps this will give some useful output, regarding to a wrong owner for
 files from world.

 It's still running.

 I still have no idea how to check this for the files build from ports.

If I understand your problem correctly, it is of incorrect owner 
group. If so, are there any problems with just running chown -R on
the parent directory (say /usr/local, where ports are installed by
default)?


  - parv

-- 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Matthias Apitz
El día Monday, January 28, 2013 a las 10:28:06PM -1000, parv escribió:

 in message op.wrms0fqkqhadp0@freebsd,
 wrote Ralf Mardorf thusly...
 
  Hi :)
 
  I hope it's ok, when I open a new thread for this issue.
  First I need to know what files have a bad owner.
 
  I'm running
  # freebsd-update IDS  outfile_28Jan2013.ids
  perhaps this will give some useful output, regarding to a wrong owner for
  files from world.
 
  It's still running.
 
  I still have no idea how to check this for the files build from ports.
 
 If I understand your problem correctly, it is of incorrect owner 
 group. If so, are there any problems with just running chown -R on
 the parent directory (say /usr/local, where ports are installed by
 default)?

In general, I find all this thread (wrong file owner) a bit boring. This
is a mayor damage and can only be repaired by a new installation. A lot
of files and directories in the systems filesystem, in / /var /usr, have
dedicated owner to allow certain processes which does not run as 'root'
to do their correct work there, for exmample 'mail'; i.e. you can not
do just a complete chown -R root   and expect that the system
still works;

the same is true for the ports below /usr/local; just run on a correct
system something like:

# find /usr/local -exec ls -ld {} \; | fgrep -v root

to get a list about what I am talking.

HIH

matthias
-- 
Sent from my FreeBSD netbook

Matthias Apitz   |  - No system with backdoors like Apple/Android
E-mail: g...@unixarea.de |  - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |  - No proprietary attachments
phone: +49-170-4527211   |  - Respect for open standards
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Ralf Mardorf
On Mon, 2013-01-28 at 22:28 -1000, parv wrote:
 in message op.wrms0fqkqhadp0@freebsd,
 wrote Ralf Mardorf thusly...
 
  Hi :)
 
  I hope it's ok, when I open a new thread for this issue.
  First I need to know what files have a bad owner.
 
  I'm running
  # freebsd-update IDS  outfile_28Jan2013.ids
  perhaps this will give some useful output, regarding to a wrong owner for
  files from world.
 
  It's still running.
 
  I still have no idea how to check this for the files build from ports.
 
 If I understand your problem correctly, it is of incorrect owner 
 group. If so, are there any problems with just running chown -R on
 the parent directory (say /usr/local, where ports are installed by
 default)?
 
 
   - parv

It's only the owner and yes, the problem is, that the owner not always
is root for important directories. I had to switch the uid for the owner
from 1001 to 1000, when I changed the owner for all files from 1001 to
1000, some owners in */bin and */lib directories were accidentally
changed too, for what reason ever.

Regards,
Ralf

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Ralf Mardorf
On Tue, 2013-01-29 at 10:08 +0100, Matthias Apitz wrote:
 This is a mayor damage and can only be repaired by a new installation.

Perhaps true, but if such a simple mistake can't be fixed, what happens
when somebody makes a big mistake? Perhaps more people stay with Linux
than other *NIX, regarding to the policy, that issues should be fixed
instead of always starting from the beginning. ;)?

Of course, if I simply would restore from a dump, it will be less time
consuming and it wouldn't annoy you, but I would have the bad feeling,
that if ever needed, thinks can't be fixed, I always would have to
restore from backups. And what happens, if for what reason ever a backup
shouldn't be available?

2 Cents,
Ralf

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Matthias Apitz
El día Tuesday, January 29, 2013 a las 12:23:09PM +0100, Ralf Mardorf escribió:

 On Tue, 2013-01-29 at 10:08 +0100, Matthias Apitz wrote:
  This is a mayor damage and can only be repaired by a new installation.
 
 Perhaps true, but if such a simple mistake can't be fixed, what happens
 when somebody makes a big mistake? Perhaps more people stay with Linux
 than other *NIX, regarding to the policy, that issues should be fixed
 instead of always starting from the beginning. ;)?
 
 Of course, if I simply would restore from a dump, it will be less time
 consuming and it wouldn't annoy you, but I would have the bad feeling,
 that if ever needed, thinks can't be fixed, I always would have to
 restore from backups. And what happens, if for what reason ever a backup
 shouldn't be available?

A damage like this can only be done with root privs and if you are root
you should be careful and think twice before; this is true for any UNIX
and Linux type system.

matthias
-- 
Sent from my FreeBSD netbook

Matthias Apitz   |  - No system with backdoors like Apple/Android
E-mail: g...@unixarea.de |  - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |  - No proprietary attachments
phone: +49-170-4527211   |  - Respect for open standards
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Erich Dollansky
Hi,

On Tue, 29 Jan 2013 10:08:20 +0100
Matthias Apitz g...@unixarea.de wrote:

 El día Monday, January 28, 2013 a las 10:28:06PM -1000, parv escribió:
 
 
 In general, I find all this thread (wrong file owner) a bit boring.

I find it very interesting.

 This is a mayor damage and can only be repaired by a new
 installation. A lot of files and directories in the systems

This is what I am doubting. Shouldn't an installation of the world
solve this problem? Or are the current owners of a directory ignored
when the world is reinstalled?

 filesystem, in / /var /usr, have dedicated owner to allow certain
 processes which does not run as 'root' to do their correct work
 there, for exmample 'mail'; i.e. you can not do just a complete
 chown -R root   and expect that the system still works;

It cannot get worse. His experience will show also others how robust
FreeBSD is in case of failures.

Erich
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

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

2013-01-29 Thread Ralf Mardorf
On Tue, 29 Jan 2013 12:44:55 +0100, Erich Dollansky  
erichsfreebsdl...@alogt.com wrote:

It cannot get worse. His experience will show also others how robust
FreeBSD is in case of failures.


Indeed. Linux users ask me why I play with FreeBSD. I already could make a  
list with drawbacks and advantages of both OS. Some of my guesses might be  
wrong, since I'm a FreeBSD novice, so this list wouldn't be absolutely  
correct.


Regarding to the annoyance, I won't switch the thread regarding to this  
issue anymore. I'll continue with this thread Re: How to fix a broken  
owner for files from world  build from ports? if this should be ok for  
the list, if not I can be quiet, no hard feelings. The thread could easily  
be filtered by most MUAs.


Regards,
Ralf
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Erich Dollansky
Hi,

On Tue, 29 Jan 2013 12:57:30 +0100
Ralf Mardorf ralf.mard...@alice-dsl.net wrote:

 On Tue, 29 Jan 2013 12:44:55 +0100, Erich Dollansky  
 erichsfreebsdl...@alogt.com wrote:
  It cannot get worse. His experience will show also others how robust
  FreeBSD is in case of failures.
 
 Indeed. Linux users ask me why I play with FreeBSD. I already could
 make a list with drawbacks and advantages of both OS. Some of my
 guesses might be wrong, since I'm a FreeBSD novice, so this list
 wouldn't be absolutely correct.
 
 Regarding to the annoyance, I won't switch the thread regarding to
 this issue anymore. I'll continue with this thread Re: How to fix a
 broken owner for files from world  build from ports? if this should
 be ok for the list, if not I can be quiet, no hard feelings. The
 thread could easily be filtered by most MUAs.
 
just continue.

erich
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Ralf Mardorf

On Tue, 29 Jan 2013 14:58:18 +0100, kpn...@pobox.com wrote:

mtree


I was confused, since the existing files only provide directories. Ok, I  
guess I understand, I can let mtree generate new files using the backup. I  
anyway need to take care about files that are missing by the backup.


Thank you.

--
Sent from my PC while wearing my Relox watch and Iccug handback.
If you pay me, product placement for your lemon could be placed here too,  
just mailto:/dev/null.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Ralf Mardorf

I'm surprised, there's no /bin/sh for the backup:
# ls -ld /bin/sh
-r-xr-xr-x  1 rocketmouse  wheel  142952 Dec 23 18:38 /bin/sh
# ls -ld /usr/TMP4DIFF/bin/sh
ls: /usr/TMP4DIFF/bin/sh: No such file or directory


This is an error in reasoning :D. I compared the original /bin, with a  
restore from /usr, so it seems to be /bin, but it is /usr/bin ;).


I have to keep the system as it is for at least a day, need to do  
something different and than I can continue, when I'm refreshed.


root@freebsd:/usr/TMP4DIFF/ROOT # ls -l bin/sh
-r-xr-xr-x  1 root  wheel  142952 Dec 23 18:38 bin/sh

:D

There definitively is need for a real rest, to avoid mistakes.

--
Sent from my PC while wearing my Relox watch and Iccug handback.
If you pay me, product placement for your lemon could be placed here too,  
just mailto:/dev/null.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Polytropon
On Tue, 29 Jan 2013 03:54:55 +0100, Ralf Mardorf wrote:
 On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom jri...@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.

A thing regarding awk: For extended formatting, use the
printf() command which works the same as in sh and C, os
if you need, you can do things like

printf %s '%s', $1, $2;

Also note that you can have a custom delimiter for parsing
the input, e. g. -F : (if you would generate input lists
in :-separated CSV format).

Additionally, it seems you're running into the fun of spaces
in file names. Even though you can put them there, it doesn't
imply it's good to do it. Spaces are separators (for commands
and options), and everytime they're _not_ (e. g. when they
appear in file names), you need to care for this fact, by
escaping or quoting them.

Maybe those articles by David A. Wheeler are interesting
to you to learn about this annoyance for people writing
short shell scripts to automate tasks:

Filenames and Pathnames in Shell: How to do it correctly

http://www.dwheeler.com/essays/filenames-in-shell.html

Fixing Unix/Linux/POSIX Filenames:
Control Characters (such as Newline), Leading Dashes, and Other Problems

http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Polytropon
On Tue, 29 Jan 2013 12:23:09 +0100, Ralf Mardorf wrote:
 On Tue, 2013-01-29 at 10:08 +0100, Matthias Apitz wrote:
  This is a mayor damage and can only be repaired by a new installation.
 
 Perhaps true, but if such a simple mistake can't be fixed, [...]

Excuse me, it's not a _simple_ mistake. It may have initially
been even a typo, but anything executed with root privileges
is not simple; root has the power to do anything, even to
completely destroy the system, and that can also be as simple
as calling rm or dd with carefully carelessly crafted options,
and there is no simple fix for this.



 [...] what happens
 when somebody makes a big mistake?

The size of the mistake doesn't even matter. :-)



 Perhaps more people stay with Linux
 than other *NIX, regarding to the policy, that issues should be fixed
 instead of always starting from the beginning. ;)?

The fix to your issue is, in pseudocode:

for part in ( OS , ports ) do:
determine owner rocketmouse:* for all files
compare with list with correct owner
for each deviating file do:
if owner != correct owner then:
chown file to correct user
fi
od
od

Of course OS and ports have to be treated seperately.

As you have mentioned to own a backup where the permissions
(owners) are correct, obtaining the required reference data
from that backup would be the easiest part.

The alternative: reinstall world, reinstall ports. To avoid
this task, you need to activate your admin skills. :-)



 Of course, if I simply would restore from a dump, it will be less time
 consuming and it wouldn't annoy you, but I would have the bad feeling,
 that if ever needed, thinks can't be fixed, I always would have to
 restore from backups. And what happens, if for what reason ever a backup
 shouldn't be available?

In that case, you would need other references to get the correct
file owners. Files are usually installed to the system by the
install command, and it is employed in the Makefiles for the
OS and also for ports. As you correctly recognized, not simply
all files belong to root, so everything non-standard could
be derived from such control files.

Of course, the more files you have to treat (see wc -l of your
result list), the harder the task can become, and maybe installing
the port again is faster than finding out where permissions are
set for the install program call. If you only have 10 files or
so, do it manually, but if there are 100 and more files, coming
from several different ports, reinstalling them sounds easier,
and it's not a big deal to do that with portmaster.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-29 Thread Ralf Mardorf
I don't use space in filenames, I just wanted to ensure, that file names  
with spaces will be handled partly correctly.
At the moment I'm not working intensively. Every once in a while I take a  
look at a directory and compare it with the backups. If there's something  
wrong, I manually run chown. I copy each step I'm doing to a file.  
Overcautious, without haste and without a script ;), I fix it step by step.


Regards,
Ralf
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf

Hi :)

I hope it's ok, when I open a new thread for this issue.
First I need to know what files have a bad owner.

I'm running
# freebsd-update IDS  outfile_28Jan2013.ids
perhaps this will give some useful output, regarding to a wrong owner for  
files from world.


It's still running.

I still have no idea how to check this for the files build from ports.

Regards,
Ralf
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Polytropon
On Mon, 28 Jan 2013 18:18:05 +0100, Ralf Mardorf wrote:
 I still have no idea how to check this for the files build from ports.

Are there _many_ on the list (rocketmouse:* in /usr/local)?

If not: A simple reinstallation of that port would be sufficient,
except you can easily spot the installation permissions from
the port's Makefile (in that case: do it manually).

The find | grep solution you're already using is sufficient
for checking. For correcting... it depends. In ultra-worst case,
re-install _all_ ports (portmaster -af plus options to avoid
undesired interactivity).


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf
The output of freebsd-update IDS  outfile_28Jan2013.ids is useless for  
this purpose.


I now will do it like that:

root@freebsd:/mnt/dump/tmp # bzcat  
../dump-9.1-RELEASE-20130123_193142-usr_f.dump | restore rf -


unfortunately it happened:

/mnt/dump: write failed, file system is full
write error extracting inode 2078075, name  
./local/share/locale/id/LC_MESSAGES/GConf2.mo

write: No space left on device
^Crestore interrupted, continue? [yn] n

;)

I still have to solve this.

Then I will run

# ls -l /usr/bin | awk '{print $3 $9}'  foo_original.txt

# ls -l /dump_dir/usr/bin | awk '{print $3 $9}'  foo_dump.txt

and diff both text files. After that I'll do it for all relevant  
directories.

How to continue depends to the output of diff.

Regards,
Ralf
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf
On Tue, 29 Jan 2013 02:21:55 +0100, Ralf Mardorf  
ralf.mard...@rocketmail.com wrote:


The output of freebsd-update IDS  outfile_28Jan2013.ids is useless  
for this purpose.


I now will do it like that:

root@freebsd:/mnt/dump/tmp # bzcat  
../dump-9.1-RELEASE-20130123_193142-usr_f.dump | restore rf -


unfortunately it happened:

/mnt/dump: write failed, file system is full
write error extracting inode 2078075, name  
./local/share/locale/id/LC_MESSAGES/GConf2.mo

write: No space left on device
^Crestore interrupted, continue? [yn] n

;)

I still have to solve this.

Then I will run

# ls -l /usr/bin | awk '{print $3 $9}'  foo_original.txt

# ls -l /dump_dir/usr/bin | awk '{print $3 $9}'  foo_dump.txt

and diff both text files. After that I'll do it for all relevant  
directories.

How to continue depends to the output of diff.


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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Joshua Isom

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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf

On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom jri...@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.


:(
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Joshua Isom

On 1/28/2013 8:54 PM, Ralf Mardorf wrote:

On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom jri...@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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf

On Tue, 29 Jan 2013 04:04:21 +0100, Joshua Isom jri...@gmail.com wrote:


On 1/28/2013 8:54 PM, Ralf Mardorf wrote:
On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom jri...@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 :).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf
On Tue, 29 Jan 2013 04:15:17 +0100, Ralf Mardorf  
ralf.mard...@rocketmail.com wrote:



On Tue, 29 Jan 2013 04:04:21 +0100, Joshua Isom jri...@gmail.com wrote:


On 1/28/2013 8:54 PM, Ralf Mardorf wrote:
On Tue, 29 Jan 2013 03:41:34 +0100, Joshua Isom jri...@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 ;).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


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

2013-01-28 Thread Ralf Mardorf
On Tue, 29 Jan 2013 04:19:08 +0100, Ralf Mardorf  
ralf.mard...@rocketmail.com wrote:


On Tue, 29 Jan 2013 04:15:17 +0100, Ralf Mardorf  
ralf.mard...@rocketmail.com wrote:


On Tue, 29 Jan 2013 04:04:21 +0100, Joshua Isom jri...@gmail.com  
wrote:



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


I guess $[...] is limited, but even with 12 and 13, it should be enough.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org