[Wylug-help] I broke my man files

RichardA pingvin at simaric.net
Wed Dec 7 22:15:38 GMT 2005


On Wed, 7 Dec 2005 20:54:01 +0000, Aaron Crane <wylug at aaroncrane.co.uk>
wrote:
> Something like this (untested) should get you started:
> 
>   for f in /usr/*/man/man*/*.gz; do
>     if file -b "$f" | grep -wqv gzip; then
>       mv -i "$f" "${f%.gz}" &&
>       gzip -9 "${f%.gz}"
>     fi
>   done
> 
> You'll need to run that as root.  I'm guessing that you were running
> as
> root when you made this mistake, so that might not be advice you need
> for the repair -- but, if so, this should be a good (if unpleasant)
> demonstration of the dangers of running ordinary commands while you
> have
> root privileges.

Mea culpa.

I think the script says: if a file isn't a gzip, rename it to .gz and
gzip it? But it's only acting on files already named .gz?
And doesn't 'mv-i' mean interactive?

Anyway, I worked on a copy this time, then moved the results back into
/usr/share. Now many man pages work, although some are blank or broken.
I can't tell if there's a pattern to them.



More information about the Wylug-help mailing list