I am compiling some access rules from failed logins and after some piping I arrived at this:
cat <
Just out of interest, I would like to keep the tried login names (the last field).
My test code would output:
Deny from 13.42.98.142 # demo
Deny from 133.142.200.152 # admin
I am looking for an output like:
Deny from 13.42.98.142 # demo, test, user
Deny from 133.142.200.152 # admin
or even better (because it would be valid .htaccess
syntax):
# demo, test, user
Deny from 13.42.98.142
# admin
Deny from 133.142.200.152
**Note**:
The input is just how I made it now - I am not stubborn with it and can change it if it suits an elegant solution better. I'll accept also general answers how grouping in lists can be achieved in shell.
Asked by Jonas Eberle
(513 rep)
May 1, 2022, 11:10 AM
Last activity: May 2, 2022, 06:01 AM
Last activity: May 2, 2022, 06:01 AM