What i'm trying to do is to use grep to search through a few files for a selected daemon and only report on today's date.
I think I got it sorted apart from in the txt file the date has 2 gaps between the month and the day, and the way I have the date format only puts in one gap any help to get the 2 gaps would be greatly received or maybe another method to get the report
echo prints its arguments separated by a single space.
If you quote $td, you are giving echo one argument. If you don't quote it, the shell expands the variable and performs word splitting on the result, giving two arguments to echo.
I have just realized that the log file I was trying to grep saves any single dates as eg: Nov 2 with 2 spaces not Nov 02 so when I created the script it was the 1st of Nov so the today variable wouldn't have worked so my prob is to try and get today's date format to output 1 didget with a double space for the single days as i tried to hard code the date as the below code and it worked