I've looked at similar questions and tried most suggestions, but none of them got me anywhere, even though i have a fairly simple task I think :S. I'm fairly new to this whole thing, so I've run out of ideas as to what to try or what I'm doing wrong...
So the task is to get the lines of a file listed (with grep) which contain the short month name and day (like Oct 22). The file has a long format listing in it (containing files created on the current date), so there should be some results. However, I'm getting results in which only the month has been examined and found, the day hasn't.
Some of the more sensible things I've tried so far:
grep $(date +"%b %e") *filename*
Then I get a line saying "grep: 22: No such file or directory" and a listing with all the results for the month ("Oct"). Same results with
+%d %e or
+'%d %e' or
'+%d %e' instead of
+"%d %e"; instead of
$(). (I also had %d for the day for a while, which made no difference, and shouldn't matter anyway as far as I know, since the date in question was now 22.)
Why is the day not taken into account here?