[Mageia-dev] Cleaning up init

Colin Guthrie mageia at colin.guthr.ie
Thu Jan 31 22:59:51 CET 2013


'Twas brillig, and Dan Fandrich at 31/01/13 14:54 did gyre and gimble:
> On Thu, Jan 31, 2013 at 10:00:36AM +0000, Colin Guthrie wrote:
>> While I'm pretty sure no such init script exists and would break
>> in other ways, it's still a valid point. I've changed it to "{}"
>> now.
> 
> True, but if we haven't told our users what their symbolic links
> should look like, we can't be going about deleting the wrong files.
> 
>> Anyone else have any comments on this?
> 
> The revised solution instead breaks when the link contains double
> quotes. How about this instead:
> 
> find -L find /etc/rc.d/rc{0,1,2,3,4,5,6,7}.d -type l -exec rm -f {}
> +

Nice trick! -L to follow links to what they point at then -type -l to
only show symlinks which, thanks to the -L, can only be broken symlinks.

The 2nd "find" is obviously a typo, but very nice trick overall :)

Cheers

Col

-- 

Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the Mageia-dev mailing list