interp: redirection to files should truncate if possible
i4ki opened this issue · 1 comments
i4ki commented
In the initial design of nash I didn't knew how redirection would work and if it would support both append redirection (>>) and truncating redirection (>). Because of that the initial implementation was very primitive, it only redirects (open the file and write) and my early scripts had to be explicit.. truncating the file before redirect when needed and using tee --append file
when append was required.
I still cannot think of a better way to handle redirections other than borne shell solved. Then nash will support > for truncating and >> for append in the same way.