diff --git a/NEWS b/NEWS index ae9667e61..a2b733d38 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,13 @@ GNU coreutils NEWS -*- outline -*- approach is still used in situations where hard links to directories are allowed (e.g., NetBSD when superuser). +** Changes in behavior + + 'test -a FILE' is not supported anymore. Long ago, there were concerns about + the high probability of humans confusing the -a primary with the -a binary + operator, so POSIX changed this to 'test -e FILE'. Scripts using it were + already broken and non-portable; the -a unary operator was never documented. + ** New features id now supports specifying multiple users. diff --git a/src/test.c b/src/test.c index aae45012a..339a84075 100644 --- a/src/test.c +++ b/src/test.c @@ -406,8 +406,7 @@ unary_operator (void) pos right past it. This means that pos - 1 is the location of the argument. */ - case 'a': /* file exists in the file system? */ - case 'e': + case 'e': /* file exists in the file system? */ unary_advance (); return stat (argv[pos - 1], &stat_buf) == 0; @@ -586,7 +585,7 @@ test_unop (char const *op) switch (op[1]) { - case 'a': case 'b': case 'c': case 'd': case 'e': + case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'k': case 'n': case 'o': case 'p': case 'r': case 's': case 't': case 'u': case 'w': case 'x': case 'z':