ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: cornet <cornet@zmail.ru>
To: mandrake-russian@linuxteam.iplabs.ru
Subject: Re: [mdk-re] Re: [mdk-re]  Удаление битых ссылок
Date: Mon Feb 12 12:14:02 2001
Message-ID: <3A87A9D2.2814A2FF@zmail.ru> (raw)
In-Reply-To: <20010210042224.A3008@LDV.fandra.org>

"Dmitry V. Levin" wrote:
> 
> On Fri, Feb 09, 2001 at 04:35:10PM +0300, cornet wrote:
> > cornet wrote:
> > > А можно как нибудь результат find гнать не в параметр запуска -exec а в
> > > трубу, и на другом конце все это сгребать в цикле, передавать в
> > > переменную $file и обрабатывать той же стокой
> > > [ ! -L "$file" -o -e "$file" ] || rm -f "$file"
> > > ???
> > Ok, уже сам справился :-))
> > Все оказалось до безобразия просто, и требуется всего ОДИН шелл на всею
> > процедуру!
> > Вызов:
> >
> > find ./ -print | ./com.sh
> >
> > Содержимое com.sh:
> >
> > #!/bin/sh
> > while read file
> > do [ ! -L "$file" -o -e "$file" ] || rm -f "$file"
> > done
> >
> > Как все оказывается просто, когда знаешь!!!
> > :-))))))))
> 
> А теперь усложним задачу. :)
> 
> Представьте себе, что среди множества подлежащих обработке файлов
> встречаются файлы с именами, содержащими, скажем, символ перевода строки.
> 
> Тогда Ваш скриптик придется слегка подправить:
> #!/bin/sh
> for file in "$@"; do
>         [ -e "$file" ] || rm -f "$file"
> done
> 
> и вызывать его так:
> find . -type l -print0 |xargs -r0 ./com.sh
> 

Ага, сеньк, об этом я как то не подумал. Хотя ума не приложу как такие
файлы вообще могут появиться :-/
Тем более, что все эти ссылки создаются из скилетной директории, которая
создана и обновляется непосредственно моими ручками и больше никак.

******** FIRE & STEEL ********



  reply	other threads:[~2001-02-12 12:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-09 12:25 denf
2001-02-09 14:16 ` [mdk-re] " Dmitry V. Levin
2001-02-09 15:36   ` cornet
2001-02-09 15:58     ` cornet
2001-02-09 16:33       ` cornet
2001-02-10  4:18         ` Dmitry V. Levin
2001-02-12 12:14           ` cornet [this message]
2001-02-09 15:29 ` cornet

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=3A87A9D2.2814A2FF@zmail.ru \
    --to=cornet@zmail.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