1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix BUG_REDIRIO

ksh used to redirect standard output by default when no file
descriptor was specified with the rarely used '<>' reading/writing
redirection operator. It now redirects standard input by default,
as POSIX specifies and as all other POSIX shells do. To redirect
standard output for reading and writing, you now need '1<>'.

Ref.: https://github.com/att/ast/issues/75
      http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_07

(cherry picked from commit 29afc16c47824fc79ed092ae7704c525b1db6a0a)
This commit is contained in:
Martijn Dekker 2020-05-13 15:00:33 +01:00
parent 915b2b2e19
commit eeee77edd1
4 changed files with 11 additions and 8 deletions

6
TODO
View file

@ -75,11 +75,5 @@ https://github.com/modernish/modernish/tree/0.16/lib/modernish/cap/
on output. This means a script cannot check for them, and a script process
in a pipe can get stuck in an infinite loop if SIGPIPE is ignored.
- BUG_REDIRIO: the I/O redirection operator <> (open a file descriptor for
both read and write) defaults to opening standard output (i.e. is short
for 1<>) instead of defaulting to opening standard input (0<>) as POSIX
specifies[*].
[*] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_07
- BUG_TESTERR1A: test/[ exits with a non-error false status (1) if an
invalid argument is given to an operator.