David Korn
2013-08-19 13:56:29 UTC
cc: simon.toedt at gmail.com ast-developers at lists.research.att.com
Subject: Re: Re: [ast-developers] ksh -c 'redirect {n}</etc/profile ; cat <&{n}' --> {n}: bad file unit number - why?
--------
==============cut here====================
--- old/sh/io.c Mon Aug 12 16:03:50 2013
+++ new/sh/io.c Sun Aug 18 21:01:22 2013
@@ -1152,6 +1152,7 @@
goto fail;
}
dupfd = nv_getnum(np);
+ np = 0;
}
else
dupfd = strtol(fname,&number,10);
==============cut here====================
David Korn
dgk at research.att.com
Subject: Re: Re: [ast-developers] ksh -c 'redirect {n}</etc/profile ; cat <&{n}' --> {n}: bad file unit number - why?
--------
ksh -c 'set -o nounset; builtin cat; redirect {n}</etc/profile ; cat
<&{n};' does not work with ast-ksh.20130814. The call just hangs.
ksh -c 'set -o nounset ; builtin cat ; redirect {n}>./my.txt ; { print
"sample1" >&{n} ; } >/dev/null ; cat my.txt ; true' does not work
either. It should print 'sample1' on stdout.
Here is a one line patch that should fix both of these.<&{n};' does not work with ast-ksh.20130814. The call just hangs.
ksh -c 'set -o nounset ; builtin cat ; redirect {n}>./my.txt ; { print
"sample1" >&{n} ; } >/dev/null ; cat my.txt ; true' does not work
either. It should print 'sample1' on stdout.
==============cut here====================
--- old/sh/io.c Mon Aug 12 16:03:50 2013
+++ new/sh/io.c Sun Aug 18 21:01:22 2013
@@ -1152,6 +1152,7 @@
goto fail;
}
dupfd = nv_getnum(np);
+ np = 0;
}
else
dupfd = strtol(fname,&number,10);
==============cut here====================
David Korn
dgk at research.att.com