[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [freebsd-fdp] find/replace [Was: slice, partition превод]



On Mon, May 03, 2004 at 07:04:20PM -0400, lou wrote:
> On Mon, May 03, 2004 at 04:41:55PM -0400, lou wrote:
> > On Mon, May 03, 2004 at 11:06:39PM +0300, Dimitar Vassilev wrote:
> > > В отговор на Anton Georgiev <ag@xxxxxxxx>:
> > > strings -a `find /usr/ports/ -name distinfo` | grep SIZE | xargs -J #SIZE.
> > -- snip -- 
> > 
> > list=`find /usr/ports -name distinfo`
> > for s in $list; do

Това може да има същия проблем с argument list too long, зависи от shell-а.

Защо просто не опитате нещо като:

  find /usr/ports/ -mindepth 3 -maxdepth 3 -type f -name distinfo |
    xargs perl -pi -e 's/^SIZE/#SIZE/'

(разбира се, на един ред :)

Частта с -mindepth 3 -maxdepth 3 може и да я пропуснете, ако искате - тя е
просто оптимизация :P  Но и с нея си е добре :)

Поздрави,
Петър

-- 
Peter Pentchev	roam@xxxxxxxxxxx    roam@xxxxxxxx    roam@xxxxxxxxxxx
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
I've heard that this sentence is a rumor.

Attachment: pgp00007.pgp
Description: PGP signature