hello,
print no line if only one or more than two has been found.
$ echo "1 2 3 stringA\n3 4 5 stringA"|awk '$NF == "stringA"'
1 2 3 stringA
3 4 5 stringA
current workaround:
TEST_INPUT="1 2 3 stringA\n3 4 5 stringB"
if [ `echo ${TEST_INPUT}|awk '$NF == "stringA"'|wc -l` -eq 2 ]
then
echo ${TEST_INPUT}|awk '$NF == "stringA"'
fi
can it be done with the only 'awk' command in:
echo "1 2 3 stringA\n3 4 5 stringB"|[red]awk '$NF == "stringA"'[/red]