> I discovered that, given a script as such:
>
> #!/bin/bash
> echo truncate >&1
>
> If it is invoked like so:
>
> echo data>test; ./iobug.sh >>test; cat test
>
> It will truncate the test file, rather than append to it. This is not
> behavior I would expect. I'm aware that it's a bit silly to redirect stdout
> to stdout, but I recently ran across a script where someone did something
> similar, which brought this to my attention.
You don't say which version of bash you're testing, but running that
pair of scripts with bash-2.05b results in
data
truncate
which is correct.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/
[Prev in Thread]
Current Thread
[Next in Thread]
Re: Appending transformed into truncation,
Chet Ramey<=