Re: while read subcommand problem

2007-03-02 Thread Richard van der Leeden
Thank you Paul, Andreas and Kevin. Both the here document solution and the Process substitution solution both work well. I haven't had a good look to see the subtle differences between the two yet. Thank you again. -- View this message in context: http://www.nabble.com/while-read-subcommand-pr

Re: while read subcommand problem

2007-03-02 Thread Paul Jarc
Andreas Schwab <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Paul Jarc) writes: >> while ...; do var=...; done <> $(generate-input-for-while) >> EOT >> use "$var" > > This has the disadvantage that generator and consumer no longer run > concurrently. Process substitution does not have this probl

Re: while read subcommand problem

2007-03-02 Thread Andreas Schwab
[EMAIL PROTECTED] (Paul Jarc) writes: > The redirection applied to "read" in those examples would be applied > to your while loop instead. For example: > > while ...; do var=...; done < $(generate-input-for-while) > EOT > use "$var" This has the disadvantage that generator and consumer no longer

Re: while read subcommand problem

2007-03-02 Thread Kevin F. Quinn
On Fri, 2 Mar 2007 03:04:14 -0800 (PST) rleeden <[EMAIL PROTECTED]> wrote: > > Hi, > > I struggled recently with a 'while read' type of loop in bash, where > after the loop had finished the variables used inside the loop are > not visible any more. I soon found the problem as explained in > sect

Re: while read subcommand problem

2007-03-02 Thread Paul Jarc
Richard van der Leeden <[EMAIL PROTECTED]> wrote: > The examples in the FAQ do work for the their examples, but I can't figure > out a clean way to implement it with a while loop when reading in lines from > the output of a piped command(s). The redirection applied to "read" in those examples woul

Re: while read subcommand problem

2007-03-02 Thread Richard van der Leeden
Paul Jarc wrote: > > > Can you explain what was unsatisfactory about the alternatives given > in the FAQ, so we have a better idea of what would be acceptable? > > Here's one possibility: > ... | { while ...; do var=...; done; use "$var"; } > > Thanks for the reply, and a possible solution

Re: while read subcommand problem

2007-03-02 Thread Paul Jarc
rleeden <[EMAIL PROTECTED]> wrote: > NOTE: This is just an example, so I don't need alternatives for how I could > achieve the specifics shown above. I need to find a good solution where I > can do things with a file (whether it be with sed, awk, tail, head etc.) > then pipe it into a 'while read'

Re: GNU bash, 3.00.15(1)-release, referenced cmd in cwd executes alternate cmd

2007-03-02 Thread Matthew Woehlke
Bob Proulx wrote: Matthew Woehlke wrote: Apparently selectively shadowing libc is non-trivial... any suggestions/hints? Not so much non-trivial as perhaps non-obvious. The dynamic loader is part of libc and so by the time the program tries to use LD_LIBRARY_PATH it is already too late because

while read subcommand problem

2007-03-02 Thread rleeden
Hi, I struggled recently with a 'while read' type of loop in bash, where after the loop had finished the variables used inside the loop are not visible any more. I soon found the problem as explained in section E4 of the FAQ. But I didn't find any of the alternate examples given very useful for w

Re: Why bash is not so efficient as cron?

2007-03-02 Thread Tim Waugh
Are the two environments setting different locales perhaps? If the character encoding is UTF-8 there is quite a bit more work that needs to be done compared to the C locale. Tim. */ signature.asc Description: This is a digitally signed message part _

Why bash is not so efficient as cron?

2007-03-02 Thread mishabear
What I have done in this test is: 1. Install a job in cron. The job is simple: grep a string in a very big file, which is a concatenation of rfcs; 2. After cron finished the job, cat the result and running time; 3. Execute the very same job under bash, then cat the result and running time; 4. The