Re: find case-insensitive challenge

2002-09-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-27 20:06:45 +0200: > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > # [EMAIL PROTECTED] / 2002-09-27 19:37:15 +0200: > > > Slower? I don't think that -name "*.[Jj][Pp][Gg]" is any > > > slower than -iname "*.jpg". > > > > i was talking about find(1) complet

Re: find case-insensitive challenge

2002-09-27 Thread Oliver Fromme
Roman Neuhauser <[EMAIL PROTECTED]> wrote: > # [EMAIL PROTECTED] / 2002-09-27 19:37:15 +0200: > > Slower? I don't think that -name "*.[Jj][Pp][Gg]" is any > > slower than -iname "*.jpg". > > i was talking about find(1) completely rewritten as a shell script. OK, sorry then. I wasn't r

Re: find case-insensitive challenge

2002-09-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-27 19:37:15 +0200: > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > the point is that emulating find with other tools would be so long > > winded that everyone would end up with find written as a shell > > script. that would be a lot slower, and someone

Re: find case-insensitive challenge

2002-09-27 Thread Oliver Fromme
Roman Neuhauser <[EMAIL PROTECTED]> wrote: > the point is that emulating find with other tools would be so long > winded that everyone would end up with find written as a shell > script. that would be a lot slower, and someone would reimplement it > in C. thus, saying that -ina

Re: find case-insensitive challenge

2002-09-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-27 18:23:27 +0200: > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > # [EMAIL PROTECTED] / 2002-09-27 18:10:04 +0200: > > > Well, almost. Those primaries which operate on the properties of the > > > inodes are required (-perm, -mtime etc.). > > > > not reall

Re: find case-insensitive challenge

2002-09-27 Thread Oliver Fromme
Roman Neuhauser <[EMAIL PROTECTED]> wrote: > # [EMAIL PROTECTED] / 2002-09-27 18:10:04 +0200: > > Well, almost. Those primaries which operate on the properties of the > > inodes are required (-perm, -mtime etc.). > > not really: ls(1). ls(1) output is not suitable for parsing, unfortun

Re: find case-insensitive challenge

2002-09-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-27 18:10:04 +0200: > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > # [EMAIL PROTECTED] / 2002-09-27 17:15:00 +0200: > > > That wouldn't make it any more portable. Bugging the Open Group > > > _might_ be more useful. > > > > right. > > > > > But then ag

Re: find case-insensitive challenge

2002-09-27 Thread Oliver Fromme
Roman Neuhauser <[EMAIL PROTECTED]> wrote: > # [EMAIL PROTECTED] / 2002-09-27 17:15:00 +0200: > > That wouldn't make it any more portable. > > Bugging the Open Group _might_ be more useful. > > right. > > > But then again, it's against the UNIX philosophy. > > In UNIX, you've got a

Re: find case-insensitive challenge

2002-09-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-27 17:15:00 +0200: > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > # [EMAIL PROTECTED] / 2002-09-27 14:36:48 +0200: > > > The problem with that is that it's not portable. I try > > > to avoid getting used to such non-portable features. > > > Typing an extra grep

Re: find case-insensitive challenge

2002-09-27 Thread Oliver Fromme
Roman Neuhauser <[EMAIL PROTECTED]> wrote: > # [EMAIL PROTECTED] / 2002-09-27 14:36:48 +0200: > > The problem with that is that it's not portable. I try > > to avoid getting used to such non-portable features. > > Typing an extra grep is faster than using -iname and > > then finding out that

Re: find case-insensitive challenge

2002-09-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-27 14:36:48 +0200: > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > you can save the grep with > > % find foo -type f -iname '*.jpg' | xargs ... > > The problem with that is that it's not portable. I try > to avoid getting used to such non-portable fea

Re: find case-insensitive challenge

2002-09-27 Thread Oliver Fromme
Roman Neuhauser <[EMAIL PROTECTED]> wrote: > # [EMAIL PROTECTED] / 2002-09-22 21:53:58 -0400: > > On Thu, 19 Sep 2002, Oliver Fromme wrote: > > > This also enables you to use grep to filter the file names in > > > a more sophisticated way than find itself can do: > > > find foo -type f | grep

Re: find case-insensitive challenge

2002-09-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-23 22:19:26 -0400: > On Mon, 23 Sep 2002, Roman Neuhauser wrote: > > you can save the grep with > > % find foo -type f -iname '*.jpg' | xargs ... > > but i think someone already posted this > > I realized another question - in my five or so years of u

Re: find case-insensitive challenge [cut/sed]

2002-09-23 Thread Mikko Työläjärvi
On 24 Sep 2002, Duncan Anker wrote: > On Tue, 2002-09-24 at 12:24, Peter Leftwich wrote: > > On Mon, 23 Sep 2002, Giorgos Keramidas wrote: > > > On 2002-09-22 21:53, Peter Leftwich <[EMAIL PROTECTED]> wrote: > > > > That leads me to wonder about using "rev" to reverse the order of > > > > charact

Re: find case-insensitive challenge [cut/sed]

2002-09-23 Thread Duncan Anker
On Tue, 2002-09-24 at 12:24, Peter Leftwich wrote: > On Mon, 23 Sep 2002, Giorgos Keramidas wrote: > > On 2002-09-22 21:53, Peter Leftwich <[EMAIL PROTECTED]> wrote: > > > That leads me to wonder about using "rev" to reverse the order of > > > characters on the line and "cut" using a field delimit

Re: find case-insensitive challenge [cut/sed]

2002-09-23 Thread Peter Leftwich
On Mon, 23 Sep 2002, Giorgos Keramidas wrote: > On 2002-09-22 21:53, Peter Leftwich <[EMAIL PROTECTED]> wrote: > > That leads me to wonder about using "rev" to reverse the order of > > characters on the line and "cut" using a field delimiter of "." :) :) > You probably could, and then use rev to

Re: find case-insensitive challenge

2002-09-23 Thread Peter Leftwich
On Mon, 23 Sep 2002, Roman Neuhauser wrote: > you can save the grep with > % find foo -type f -iname '*.jpg' | xargs ... > but i think someone already posted this I realized another question - in my five or so years of using the find command, I have never until now used the "-type

Re: find case-insensitive challenge

2002-09-23 Thread Giorgos Keramidas
On 2002-09-22 21:53, Peter Leftwich <[EMAIL PROTECTED]> wrote: > You know, it's sad but in all my nine (9) years of grepping, I never once > used the "$" -- the "^" for "line beginning with" yes, but never the > immensely useful "$" in order to obtain the .xxx extensions :) > > That leads me to w

Re: find case-insensitive challenge

2002-09-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2002-09-22 21:53:58 -0400: > On Thu, 19 Sep 2002, Oliver Fromme wrote: > > This also enables you to use grep to filter the file names in > > a more sophisticated way than find itself can do: > > find foo -type f | grep -i '\.jpg$' | xargs -J % mv % bar > > Amazing, I just wa

Re: find case-insensitive challenge

2002-09-22 Thread Peter Leftwich
On Thu, 19 Sep 2002, Oliver Fromme wrote: > Peter Leftwich <[EMAIL PROTECTED]> wrote: > > Tonight I surprised myself by running `find ~/Desktop/folder/ -name "*.jpg" > > -exec mv {} ~/Desktop/folderjpgs/ \;` successfully! My first custom find > > command line ever. > In general, it is a good i

Re: find case-insensitive challenge

2002-09-20 Thread Oliver Fromme
Tim Peters <[EMAIL PROTECTED]> wrote: > FYI, find and xargs can work with weird filenames (as long as they > don't contain a \0) with these kind of options: > > find . -print0 | xargs -0 command UNIX filenames cannot contain '\0' bytes, so you're safe. (There are only two characters disallo

Re: find case-insensitive challenge

2002-09-19 Thread Tim Peters
On Fri, Sep 20, 2002 at 09:05:10AM +1000, Duncan Anker wrote: > > > > find foo -type f | grep -i '\.jpg$' | xargs -J % mv % bar > > > > My preferred method also. But ... I can never get that to work if there > are spaces (or other illegal characters) in the file names. > > And no, I don't usua

Re: find case-insensitive challenge

2002-09-19 Thread Duncan Anker
On Thu, 2002-09-19 at 23:53, Oliver Fromme wrote: > > In general, it is a good idea to try to avoid -exec, because > it is inefficient. -exec runs the specified command for every > single file, whilch can be terribly slow if there are a lot of > files. Better use xargs instead, which will colle

Re: find case-insensitive challenge

2002-09-19 Thread Oliver Fromme
Peter Leftwich <[EMAIL PROTECTED]> wrote: > Tonight I surprised myself by running `find ~/Desktop/folder/ -name "*.jpg" > -exec mv {} ~/Desktop/folderjpgs/ \;` successfully! My first custom find > command line ever. > > But there were two issues -- I had to escape the semicolon with a "\" -

Re: find case-insensitive challenge

2002-09-19 Thread Matt Smith
Or, try "-iname" instead of "-name" man find ... -iname pattern Like -name, but the match is case insensitive. ... Hope that helps, -Matt On Thu, 2002-09-19 at 07:57, Brian T. Schellenberger wrote: > > > > On Thursday 19 September 2002 01:38 am, Peter Leftwich wrote: > | Tonigh

Re: find case-insensitive challenge

2002-09-19 Thread Brian T. Schellenberger
On Thursday 19 September 2002 01:38 am, Peter Leftwich wrote: | Tonight I surprised myself by running `find ~/Desktop/folder/ -name | "*.jpg" -exec mv {} ~/Desktop/folderjpgs/ \;` successfully! My first | custom find command line ever. | | But there were two issues -- I had to escape the semic

Re: find case-insensitive challenge

2002-09-18 Thread Giorgos Keramidas
On 2002-09-19 01:38, Peter Leftwich <[EMAIL PROTECTED]> wrote: > Tonight I surprised myself by running > `find ~/Desktop/folder/ -name "*.jpg" -exec mv {} ~/Desktop/folderjpgs/ \;` > But there were two issues -- I had to escape the semicolon with a "\" -- > does this ever cause problems for find

Re: find case-insensitive challenge

2002-09-18 Thread Nick Slager
Thus spake Peter Leftwich ([EMAIL PROTECTED]): > But there were two issues -- I had to escape the semicolon with a "\" -- > does this ever cause problems for find command lines? Second, this found No, its a requirement to ensure the shell ignores the character. > only *.jpg files and left beh

find case-insensitive challenge

2002-09-18 Thread Peter Leftwich
Tonight I surprised myself by running `find ~/Desktop/folder/ -name "*.jpg" -exec mv {} ~/Desktop/folderjpgs/ \;` successfully! My first custom find command line ever. But there were two issues -- I had to escape the semicolon with a "\" -- does this ever cause problems for find command lines?