Re: Re: The Insane Asylum BBs TEST
By: Tracker1 to DaiTengu on Tue Jul 26 2022 08:12 am
I know these things exist and how piped stdio works... would generally just write a small program or script for things like this. I'm
definitely less than efficient at unix cli tools.
heh, it looks complex, but it's pretty simple.
grep -ve "^;" nodelist.127 - prints out all lines in nodelist.127 that don't start with a semicolon (which is a comment)
| - pipes the output to the next command in line (I'll skip over this bit with the rest of the descriptions)
awk -F',' '{print $3}' - since the nodelist separates fields by a comma, -F',' sets the comma as the field separator, then prints the 3rd field from each line, which is the system name.
grep -i asylum - searches the output for anything including the string "asylum" ignoring case (-i) "TeH_aSYLuM" would match as would "asylum_bbs"
sort - sorts the data in alphabetical order, this is important because the next command does not count the number of occurances unless they are adjacent to each other.
uniq -c - counts the number of occurances of adjacent lines, outputs data with <num> <line>
sort -nr - sorts the output in numerical order with the highest numbers first (reverse from normal)
head -20 - prints only the first 20 lines (this wasn't really needed, there were 22 lines in total)
DaiTengu
... Half of conversation is listening.
---
þ Synchronet þ War Ensemble BBS - The sport is war, total war - warensemble.com