May 2000
Beginner
761 pages
18h 20m
English
If you open a pipe in an awk program, you must close it before opening another one. The command on the right-hand side of the pipe symbol is enclosed in double quotes. Only one pipe can be opened at a time.
(The Database) % cat names john smith alice cheba george goldberg susan goldberg tony tram barbara nguyen elizabeth lone dan savage eliza goldberg john goldenrod (The Command Line) % awk '{print $1, $2 | "sort –r +1 –2 +0 –1 "}' names (The Output) tony tram john smith dan savage barbara nguyen elizabeth lone john goldenrod susan goldberg george goldberg eliza goldberg alice cheba |
Explanation
Awk will pipe the output of the print statement as input to the UNIX sort command, which does a reversed sort using the ...
Read now
Unlock full access