Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the environment for assignement 2 ? #14

Open
rastaman opened this issue Aug 12, 2024 · 0 comments
Open

What is the environment for assignement 2 ? #14

rastaman opened this issue Aug 12, 2024 · 0 comments

Comments

@rastaman
Copy link

rastaman commented Aug 12, 2024

Hi there i look at your assignments and would like to know in which environment the script is running? Are sed, uniq, sort available? In this case a simple solution like this can be enough and accepted? or do you would like it more prodable perhaps?

function count() { 
∙   cat $1 | sed -e 's/ -.*//' | sort | uniq -c | sort -nr | sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//;s/\(.*\) \(.*$\)/\2 \1/' | head -8
∙ }
❯ count logfile.txt 
92.6.41.236 22
186.248.72.9 19
81.243.137.36 17
217.118.78.16 15
213.118.39.51 15
93.146.139.64 14
80.116.15.0 14
186.213.159.176 11

Thanks for your time! :-)

Edit: added head -8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant