On Mon, May 05, 2014 at 05:40:03 -0400, Robert P. J. Day wrote:
> 
> $ echo test2 >&${foofd}
> $ cat /tmp/foo.out
> test1
> test2
> $
> 
> it *appends* to the file, which is not what i was expecting.
 
I'm guessing you were expecting the fd to be automatically closed, but I
don't think that would make much sense.

Close fd:
$ {foofd}>&-

Allocate fd:
$ {foofd}>/tmp/foo.out

Write to fd:
$ echo test3 >&$foofd

$ cat /tmp/foo.out
test3

Joe

_______________________________________________
Linux mailing list
Linux@lists.oclug.on.ca
http://oclug.on.ca/mailman/listinfo/linux

Reply via email to