d92eec9
diff -up ksh-20120801/src/cmd/ksh93/sh/io.c.filecombsubst ksh-20120801/src/cmd/ksh93/sh/io.c
d92eec9
--- ksh-20120801/src/cmd/ksh93/sh/io.c.filecombsubst	2014-02-26 16:15:52.355391420 +0100
ebf9b31
+++ ksh-20120801/src/cmd/ksh93/sh/io.c	2014-02-26 16:23:55.588148801 +0100
ebf9b31
@@ -1326,6 +1326,7 @@ int	sh_redirect(Shell_t *shp,struct iono
ebf9b31
 				if(flag==SH_SHOWME)
ebf9b31
 					goto traceit;
ebf9b31
 				fd=sh_chkopen(fname);
ebf9b31
+				fd=sh_iomovefd(fd);
ebf9b31
 			}
ebf9b31
 			else if(sh_isoption(SH_RESTRICTED))
ebf9b31
 				errormsg(SH_DICT,ERROR_exit(1),e_restricted,fname);