I need to use the result of a formatted date command (date +"%m/%d") as the grep filter to filter the results of another command that will display alerts on a system so that I only see alerts from the given day.
Lets say alertcommand gives the alert readout in the console.
I know I can do alertcommand | grep 8/10
to get the logs from today, but I want to be able to feed date +"%m/%d"
into that so that I don't have to specify the date each time I run it, but I can't figure out how to link it into one single command (preferably without having to create temp files or anything as this will be run on customer hardware).
I looked at this question that was similar, but couldn't figure out how to make it work the same way.