Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-06 Thread Adam Funk
Almut Behrens wrote: > (It's called from within launch(), which is handling the option -exec) > > This function is simply not present in the old sources (4.1.20). > > Well, I guess it's worth filing a bug report, to let the original > authors figure out what it was that made them add this code -

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-06 Thread Adam Funk
Andrew Schulman wrote: > >> On Tue, Jul 05, 2005 at 05:51:07AM -0400, Andrew Schulman wrote: >> >>> find ... -print0 | xargs -0r rm -i >> >> This won't work because rm -i reads for confirmation from stdin and rm >> has no stdin when it's run via xargs. > > Hm, you're right. Well one alternati

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-06 Thread Adam Funk
Almut Behrens wrote: >> I'm running "testing", and dpkg says I'm using bash 3.0-15 and findutils >> 4.2.22-1. > > It seems to be a bug (or feature?) of find. > (I can even reproduce the behaviour when moving the debian-testing find > binary to a somewhat older SuSE box -- where the command in que

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Andrew Schulman
> P.S. The reason that "find ... -print0 | xargs -0r rm -i" exhibits the > same behaviour is a different one: Here, find's stdin filehandle would > somehow have to be passed through to rm (via xargs, which in turn has > its stdin attached to find's stdout), in order for rm to be able to > read fr

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Andrew Schulman
> On Tue, Jul 05, 2005 at 05:51:07AM -0400, Andrew Schulman wrote: > >> find ... -print0 | xargs -0r rm -i > > This won't work because rm -i reads for confirmation from stdin and rm > has no stdin when it's run via xargs. Hm, you're right. Well one alternative that will definitely work is fin

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Almut Behrens
On Tue, Jul 05, 2005 at 12:41:48PM +0100, Adam Funk wrote: > michael wrote: > > Well on 'sarge', under bash, the > > find . -name 'whatever' -exec rm -i {} ";" > > works as expected for me, but the above example exhibits the same > > performance as you note (I'm no 'xargs' expert and can's see wh

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Dave Carrigan
On Tue, Jul 05, 2005 at 05:51:07AM -0400, Andrew Schulman wrote: > find ... -print0 | xargs -0r rm -i This won't work because rm -i reads for confirmation from stdin and rm has no stdin when it's run via xargs. -- Dave Carrigan Seattle, WA, USA [EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Adam Funk
michael wrote: > Well on 'sarge', under bash, the > find . -name 'whatever' -exec rm -i {} ";" > works as expected for me, but the above example exhibits the same > performance as you note (I'm no 'xargs' expert and can's see what the > '-0r' option is meant to do) > > If I were you I'd check t

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread michael
On Tue, 2005-07-05 at 11:36 +0100, Adam Funk wrote: > Andrew Schulman wrote: > > >> Why did this behaviour change, and how can I fix my script? > > > > An alternative is > > > > find ... -print0 | xargs -0r rm -i > > I get the same problem with that! > > $ find . -name '*~' -print0 |xargs -0r

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Adam Funk
Andrew Schulman wrote: >> Why did this behaviour change, and how can I fix my script? > > An alternative is > > find ... -print0 | xargs -0r rm -i I get the same problem with that! $ find . -name '*~' -print0 |xargs -0r rm -i rm: remove regular file `./.emacs.d/auto-save-list/.saves-20203-viln

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Adam Funk
Dave Ewart wrote: >> Recently it stopped working because "rm -i" in "find..." no longer >> appears >> connected to the console for input. Typing "find -name '*~' -exec rm -i >> '{}' ';'" directly prints a list of rm-questions, doesn't get an answer, >> and so does nothing. >> >> Why did this beh

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Andrew Schulman
> I have a script called texclean as follows: > > #!/bin/sh > if [ -z "$1" ]; then > DEPTH=1; > else > DEPTH=$1; > fi; > for PATTERN in '*~' '*.log' '*.aux' '*.bbl' '*.blg' '*.toc' \ >'*.lof' '*.lot' '#*#'; > do > find . -maxdepth $DEPTH -name "$PATTERN" -exec rm -i '{}

Re: Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Dave Ewart
On Tuesday, 05.07.2005 at 10:03 +0100, Adam Funk wrote: > I have a script called texclean as follows: > > #!/bin/sh > if [ -z "$1" ]; then > DEPTH=1; > else > DEPTH=$1; > fi; > for PATTERN in '*~' '*.log' '*.aux' '*.bbl' '*.blg' '*.toc' \ >'*.lof' '*.lot' '#*#'; > do >

Why has "find ... -exec rm -i '{}' ';'" stopped working?

2005-07-05 Thread Adam Funk
I have a script called texclean as follows: #!/bin/sh if [ -z "$1" ]; then DEPTH=1; else DEPTH=$1; fi; for PATTERN in '*~' '*.log' '*.aux' '*.bbl' '*.blg' '*.toc' \ '*.lof' '*.lot' '#*#'; do find . -maxdepth $DEPTH -name "$PATTERN" -exec rm -i '{}' ';'; done Recently i

Re: oddity with find -exec grep -i

2004-10-31 Thread Mirek Stefanski
I think you simply miss --ignore-case in second grep (first grep find it but dont convert the case so the second can't find the pattern) Try add -i to the second grep. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Re: oddity with find -exec grep -i

2004-10-31 Thread Thomas Adam
--- Chris Evans <[EMAIL PROTECTED]> wrote: > #!/bin/bash > /usr/bin/find /usr/lib/ecartis/lists/ -name users -print \ > -exec grep --ignore-case "$1" {} \; | grep -B 1 "$1" Odd, it works fine for me. Are you sure there is no other factor? -- Thomas Adam = "The Linux Weekend Mechanic" -

oddity with find -exec grep -i

2004-10-31 Thread Chris Evans
Perhaps I am looking straight through things, if so, I'm sorry. I have effectively a one liner shell script that I want to run to see if any text (typically an Email address) is in any file named "users" in any directory below a particular directory, easy I thought: #!/bin/bash /usr/bin/find /

thanks! (was: find -exec)

1999-11-14 Thread aphro
thanks for the massive response i got from my find -exec question i ended up going with martin's suggestion of find . -type t | xargs chmod ug+wx ..it executed a full 2 minutes quicker then using find -exec. thanks again!! woohoo. nate [mailto:[

Re: find -exec

1999-11-14 Thread John Pearson
On Fri, Nov 12, 1999 at 11:48:49PM -0800, aphro wrote > What i wanna do ..is 2 things > > find all files in a directory tree and chmod them 644 > > find all directories in a directory tree and chmod them 775 > > and i'm trying to do it with the find -exec command.

Re: find -exec

1999-11-13 Thread Martin Fluch
-BEGIN PGP SIGNED MESSAGE- On Fri, 12 Nov 1999, aphro wrote: > What i wanna do ..is 2 things > > find all files in a directory tree and chmod them 644 > > find all directories in a directory tree and chmod them 775 [...] > find . -exec chmod u+wx {} -type f >

Re: find -exec

1999-11-13 Thread Gregory T. Norris
> find . -exec chmod u+wx {} -type f The -exec portion of the command must be terminated by `;', which must also be escaped to the shell. As in: find . -exec chmod u+wx {} \; -type f

Re: find -exec

1999-11-13 Thread Dave Baker
> What i wanna do ..is 2 things > > find all files in a directory tree and chmod them 644 > > find . -exec chmod u+wx {} -type f > try this: find . -type f -exec echo {} \; I've replaced the chmod with a painless payload so you can test it out first. the \; is requ

find -exec

1999-11-13 Thread aphro
What i wanna do ..is 2 things find all files in a directory tree and chmod them 644 find all directories in a directory tree and chmod them 775 and i'm trying to do it with the find -exec command. For the directory part i did get this working: chmod 7755 `find . -type d` but for the file

Solution: find -exec

1998-07-31 Thread Ulisses Alonso
Hi all! I reply myself here On Wed, 29 Jul 1998, Oliver Elphick wrote: > Ulisses Alonso wrote: > > > >Hi all > > > >I would like to know if there is a way to make something like this > > > >find -exec command1 {} | command2 \; > > I t

Re: find -exec

1998-07-30 Thread Jens Ritter
Ulisses Alonso <[EMAIL PROTECTED]> writes: > Hi all > > I would like to know if there is a way to make something like this > > find -exec command1 {} | command2 \; > xargs? HTH, Jens --- [EMAIL PROTECTED] [EMAIL PROTECTED] Key ID: 2048/

Re: find -exec

1998-07-29 Thread Oliver Elphick
Ulisses Alonso wrote: > >Hi all > >I would like to know if there is a way to make something like this > >find -exec command1 {} | command2 \; I take it you want to run the pipeline `command1 | command2' on each file. I don't think you can do this with

find -exec

1998-07-29 Thread Ulisses Alonso
Hi all I would like to know if there is a way to make something like this find -exec command1 {} | command2 \; Thanks in advance, Ulisses PD: Oracle8 and Informix will be ported to Linux! http://www.infoworld.com/cgi-bin/displayStory.pl?980717.whorlinux.htm