4 ms·
Am I missing something or is the article's central example using `tail` fundamentally broken? The `sort` blocks until input is closed yet `tail -f` never close
by frumiousirc 3y ago
Am I missing something or is the article's central example using `tail` fundamentally broken?
The `sort` blocks until input is closed yet `tail -f` never closes its output.
- deleted 3y ago[deleted]
- JdeBP 3y agoYou'll be pointing out that [ is a built-in command, next. (-:
- rascul 3y agoIt's also a binary in /bin (or a symlink because of /usr merge) and it's silly that the article tries to view [ in a pager.
- sgarland 3y agoNot to mention, they're under-using awk. Tailing this seems completely unnecessary. The original from TFA: `tail -fq /var/log/nginx/access.log | awk '{print $7}' | sort | uniq -c | sort -rn` can be replaced with: `awk '{ a[$7]++ } END { for (i in a) print " " a[i] " " i }' /var/log/nginx/access.log | sort -rn` or, if you have GNU awk: `awk '{ a[$7]++ } END { PROCINFO["sorted_in"] = "@val_num_desc"; for (i in a) print " " a[i] " " i }' /var/log/nginx/access.log`