Re: Mixing exec redirection with explicit redirection, unexpected results

2009-12-08 Thread Chet Ramey
r...@enterprise.herff-jones.com wrote: > When I use the 'exec' built-in to redirect standard output > for a script, and then also use explicit redirection on > other commands, pointing both to the same output file, > I get unpredictable (but repeatable) results with the

Re: Mixing exec redirection with explicit redirection, unexpected results

2009-12-08 Thread John Reiser
#!/bin/bash > /tmp/foo exec 1>/tmp/foo echo a echo B>>/tmp/foo echo c echo D>>/tmp/foo echo e echo F>>/tmp/foo That script creates two simultaneous writers of /tmp/foo (one via the "exec >", another via each "echo >>") but does not provide any concurrency control. Shame on the script; the resu

Mixing exec redirection with explicit redirection, unexpected results

2009-12-08 Thread root
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPAC