Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #1717

Re: calling script function on output of find

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From John Stumbles <john.stumbles@ntlworld.com>
Newsgroups comp.os.linux.misc
Subject Re: calling script function on output of find
Date 9 Jul 2011 12:51:29 GMT
Lines 23
Message-ID <97r16hFb0uU4@mid.individual.net> (permalink)
References <97g5odFp36U1@mid.individual.net> <mr7ge8xnbe.ln2@news.roaima.co.uk> <97o2suFrvqU1@mid.individual.net> <uflje8xed5.ln2@news.roaima.co.uk>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace individual.net MvaewUucpd1/Yhor/tpnXghyixgVT+uP5t4HWrX8W/5uIu/g/f
Cancel-Lock sha1:dxmLZ8k0RLcyw/dFXHmZzFLjZTI=
User-Agent Pan/0.133 (House of Butterflies)
Xref x330-a1.tempe.blueboxinc.net comp.os.linux.misc:1717

Show key headers only | View raw


On Fri, 08 Jul 2011 16:48:46 +0100, Chris Davies wrote:

> So, there is now no sensible option but to turn the construct inside
> out, which is why the other posters suggested such things as this:
>     find "$SOURCE_DIR" -type f -size +0 | while read f; do process_file
>     "$f"; done

OK, thanks, it was the "turning the construct inside out" I didn't get.
I still don't see that as turning it inside out, but I thought you were 
suggesting some yet-different solution the others hadn't.


> Please note, that if your process_file needs to update variables that
> are used later in your script, or if your pathnames contain embedded
> newlines and/or leading spaces, this solution WILL NOT WORK. Come back
> here for more pathologically correct answers.

Like "use Perl" ;-)

-- 
John Stumbles

Procrastinate now!

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-05 10:01 +0000
  Re: calling script function on output of find Joe Makowiec <makowiec@invalid.invalid> - 2011-07-05 10:20 +0000
    Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-09 12:04 +0000
  Re: calling script function on output of find dave.gma+news002@googlemail.com.invalid (Dave Gibson) - 2011-07-05 19:17 +0100
    Re: calling script function on output of find unruh <unruh@wormhole.physics.ubc.ca> - 2011-07-05 20:01 +0000
      Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-09 12:21 +0000
        Re: calling script function on output of find Bill Marcum <bill@lat.localnet> - 2011-07-12 19:43 -0400
          Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-16 00:26 +0000
    Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-09 12:48 +0000
      Re: calling script function on output of find dave.gma+news002@googlemail.com.invalid (Dave Gibson) - 2011-07-09 19:52 +0100
  Re: calling script function on output of find Chris Davies <chris-usenet@roaima.co.uk> - 2011-07-07 09:37 +0100
    Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-08 10:02 +0000
      Re: calling script function on output of find Chris Davies <chris-usenet@roaima.co.uk> - 2011-07-08 16:48 +0100
        Re: calling script function on output of find unruh <unruh@wormhole.physics.ubc.ca> - 2011-07-08 17:46 +0000
          Re: calling script function on output of find Chris Davies <chris-usenet@roaima.co.uk> - 2011-07-08 20:56 +0100
            Re: calling script function on output of find unruh <unruh@wormhole.physics.ubc.ca> - 2011-07-08 21:14 +0000
              Re: calling script function on output of find Chris Davies <chris-usenet@roaima.co.uk> - 2011-07-09 11:17 +0100
        Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-09 12:51 +0000
          Re: calling script function on output of find Chris Davies <chris-usenet@roaima.co.uk> - 2011-07-10 10:45 +0100
            Re: calling script function on output of find John Stumbles <john.stumbles@ntlworld.com> - 2011-07-10 23:14 +0000

csiph-web