[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gawk manual porting problem with POSIX 1003.1-2001 "sort"
From: |
Paul Eggert |
Subject: |
gawk manual porting problem with POSIX 1003.1-2001 "sort" |
Date: |
Sun, 10 Feb 2002 01:30:12 -0800 (PST) |
The gawk manual uses some obsolete shell syntax for "sort" that has
been withdrawn in POSIX 1003.1-2001. (My test version of "sort"
issues a warning for the obsolete syntax.) Here is a patch.
2002-02-10 Paul Eggert <address@hidden>
* gawk.texi (Word Sorting): Don't use sort +1, as POSIX 1003.1-2001
no longer allows it. Use sort -k instead.
--- gawk.texi 2001/05/27 20:02:49 3.0.98.3
+++ gawk.texi 2002/02/10 08:55:20 3.0.98.4
@@ -19793,7 +19793,7 @@ Assuming we have saved this program in a
and that the data is in @file{file1}, the following pipeline:
@example
-awk -f wordfreq.awk file1 | sort +1 -nr
+awk -f wordfreq.awk file1 | sort -k 2nr
@end example
@noindent
@@ -19814,7 +19814,7 @@ the @code{END} action to:
@example
@c file eg/prog/wordfreq.awk
END @{
- sort = "sort +1 -nr"
+ sort = "sort -k 2nr"
for (word in freq)
printf "%s\t%d\n", word, freq[word] | sort
close(sort)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gawk manual porting problem with POSIX 1003.1-2001 "sort",
Paul Eggert <=