Image

Imagehonsou wrote in Imagelinux 😤working Work

Listens: Orbital - Halcyon & On & On

My Brain is Dying I think...

I'm working on learning bash scripting. I've been tasked with some simple extraction of logs to a text file, which I can do by hand, but they want it so that it's in bash and that users can have access to run it on the fly - or it can be cronned out to run at a regular interval. So I've never done any scripting before - I basically need to do this:

grep -c "some data" some.log
grep -c "different data" some.log

I need to then take the results of 'some data' and subtract them from 'different data' so basically I end up with 3 sets of data.

I've googled this but must not be googling the proper phrase because it's not helping with what I need to do.

Any ideas?

Thanks
-K