On Tue, Jan 29, 2013 at 10:19:46AM +0000, Colin Guthrie wrote: > find /etc/rc.d/rc{0,1,2,3,4,5,6,7}.d -type l -exec sh -c 'if [ ! -e {} > ]; then rm -f {}; fi' \; > > This does much the same job, but "find" is already used in multiple > places so probably a better solution even if the command is more convoluted! > > If anyone spots any issues with this, please shout.
This solution has a problem handling files with embedded spaces and special shell characters. It could potentially be bad if run on a system where a link such as "/etc/rc.d/rc0.d/S01Super * Star Program" exists. >>> Dan