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
#!/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
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