ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Mikhail Zabaluev <mookid@sigent.ru>
To: mandrake-russian@linuxteam.iplabs.ru
Subject: [mdk-re] Re: [mdk-re] Удаление битых ссылок
Date: Tue Feb 13 09:13:01 2001
Message-ID: <20010213090529.D2230@localhost.localdomain> (raw)
In-Reply-To: <3A87A901.9FFC6E5A@zmail.ru>; from cornet@zmail.ru on Mon, Feb 12, 2001 at 12:12:33PM +0300

Hello cornet,

On Mon, Feb 12, 2001 at 12:12 +0300, cornet wrote:
>
> Mikhail Zabaluev wrote:
> > 
> > Hello cornet,
> > 
> > On Fri, Feb 09, 2001 at 12:01 +0300, cornet wrote:
> > >
> > > Hello!!
> > >
> > > Волею судеб, на сервере в одном каталоге и его подкаталогах образуется
> > > большое количество битых символических ссылок (то есть указывающих на
> > > уже не_существующие файлы). Этих ссылок много и чистить их руками сильно
> > > ломает. Может подскажет кто простой способ автоматизации этого дела?
> > > Хотелось бы залудить на cron скриптик, который лез бы в вышеозначеный
> > > каталог и рекурсивно долбал бы все эти битые ссылки.
> > 
> > find <каталог> -type l -ls | awk '{ N1 = NF - 2; print $N1; print $NF }' |
> >     while read link && read file; do
> >         [ -n "${file##/*}" ] && file=`dirname $link`/$file
> >         [ -e "$file" ] || rm -f "$link"
> >     done
> 
> Уййёёёё!!
> Дааа, Вы не ищете легких путей :-))
> Ладно, попробую разобраться в этом ураганном синтаксисе. В любом случае
> -- спасибо :-))

Каюсь, забыл, что 'test -e' проверяет не ссылку, а адресата. Век живи, 
дураком помрешь. Более внимательные уже изложили простое решение.

-- 
Stay tuned,
  MhZ                                    mailto:mookid@sigent.ru
-----------
Punishment becomes ineffective after a certain point.  Men become insensitive.
		-- Eneg, "Patterns of Force", stardate 2534.7



      reply	other threads:[~2001-02-13  9:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-09 12:00 cornet
2001-02-10 14:25 ` [mdk-re] " Mikhail Zabaluev
2001-02-12 12:10   ` cornet
2001-02-13  9:13     ` Mikhail Zabaluev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010213090529.D2230@localhost.localdomain \
    --to=mookid@sigent.ru \
    --cc=mandrake-russian@linuxteam.iplabs.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git