3 ms·
Yes, there are some ways to simplify. You can get rid of the "UUOC". Instead of cat data.txt | grep -v '#' you can do: grep -v '#' data.txt or you
by oftenwrong 13y ago
Yes, there are some ways to simplify. You can get rid of the "UUOC". Instead of
cat data.txt | grep -v '#'
you can do:
grep -v '#' data.txt
or you can simplify further by moving the grepping into awk, so that the full command becomes
awk '!/#/{print $2}' data.txt | sort -n | uniq -c
sort -n is good to use for sorting numbers. You could probably pull the sort | uniq -c into awk somehow, but I have already demonstrated the full extent of my awk knowledge. One of these days I will get around to actually learning it.