Re: bash - executing function in "find" command

2005-07-06 Thread Paul Smith
%% "Chris F.A. Johnson" <[EMAIL PROTECTED]> writes: cfaj> On 2005-07-06, Paul Smith wrote: >> The disadvantage of the pipe-to-while method is that each element >> in the pipeline is run in a subshell, so variables set inside the >> while loop (for example) won't be set after the loop is

Re: bash - executing function in "find" command

2005-07-06 Thread Chris F.A. Johnson
On 2005-07-06, Paul Smith wrote: > > The disadvantage of the pipe-to-while method is that each element in the > pipeline is run in a subshell, so variables set inside the while loop > (for example) won't be set after the loop is complete[*]. find . | { while read line do : whatever w

Re: bash - executing function in "find" command

2005-07-05 Thread Paul Smith
%% Dexter <[EMAIL PROTECTED]> writes: >> find . | while read file; do ; done d> I tried before something like: d> F=$(find .);for I in $F;do ; done Besides breaking on filenames with embedded whitespace, this method has the other major disadvantage that it collects the entire output into

Re: bash - executing function in "find" command

2005-07-05 Thread Dexter
On Tue, 2005-07-05 at 18:53 -0400, Paul Smith wrote: > %% Dexter <[EMAIL PROTECTED]> writes: > > d> But I want to use bash function instead of command. > > You can't. > > d> Problem is not, that command "find" runs in different environment, and > d> doesn't know variables and functions fro

Re: bash - executing function in "find" command

2005-07-05 Thread Paul Smith
%% Dexter <[EMAIL PROTECTED]> writes: d> But I want to use bash function instead of command. You can't. d> Problem is not, that command "find" runs in different environment, and d> doesn't know variables and functions from parent shell. Yes it is. d> Because i tried: d> A="XXX" d>

Re: bash - executing function in "find" command

2005-07-05 Thread Gregory Seidman
On Wed, Jul 06, 2005 at 12:44:25AM +0200, Dexter wrote: } Hi, } bash command "find" let's you execute other commands like this: [...] This is where your problem comes up. The find command is a standalone program, and unrelated to bash. } Somebody has a idea how to run function there? This is wha