why do this command's output is zero?
What are you trying to do?
If you want to count the number of lines containing Exception:
awk '/Exception/ { ++i } END { print i }' trace
If you want to concatenate all lines containing Exception:
awk '/Exception/ { i = i $0 } END { print i }' trace
Or, if you want to preserve the lines:
awk '/Exception/ { i = i $0 "\n" } END { printf "%s", i }' trace --
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
|