From f86bb6967dba1e2b6026997963a90e00cd641490 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 1 Feb 2010 15:19:08 +0000 Subject: join: make -t '' operate on the whole line Previously passing an empty parameter to -t would raise an error, but now it means to treat each line as a single field for matching. This matches the default operation of `sort` which is usually used in conjunction with join. * src/join.c (main): Set the field delimiter to '\n' if an empty parameter is passed to -t. (usage): Mention the operation of -t ''. * tests/misc/join: Add 2 new tests, for the existing -t '\0' and the new -t '' functionality. * doc/coreutils.texi (join invocation): Mention that join -t '' always operates on the whole line, while join -t '\0' usually does. * NEWS: Mention the change in behavior. --- tests/misc/join | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/misc/join b/tests/misc/join index 4e7798fd9..cef813773 100755 --- a/tests/misc/join +++ b/tests/misc/join @@ -51,6 +51,11 @@ my @tv = ( ['3a', '-t:', ["a:1\nb:1\n", "a:2:\nb:2:\n"], "a:1:2:\nb:1:2:\n", 0], +# operate on whole line (as sort does by default) +['3b', '-t ""', ["a 1\nb 1\n", "a 1\nb 2\n"], "a 1\n", 0], +# use NUL as the field delimiter +['3c', '-t "\\0"', ["a\0a\n", "a\0b\n"], "a\0a\0b\n", 0], + # Just like -a1 and -a2 when there are no pairable lines ['4a', '-v 1', ["a 1\n", "b\n"], "a 1\n", 0], ['4b', '-v 2', ["a 1\n", "b\n"], "b\n", 0], -- cgit v1.2.3-70-g09d2