Hi,
I have a bash script that returns a list of files in the current directory that were modified today. Here is what I have:
This works great when the day is 10-31, but not if the day is between 1 and 9. For single digit days I have to change the script to add a space between %b and %d. I'm sure there is a better way to do what I'm trying to do here, thanks in advance!
PS. Running on a Pi.
I have a bash script that returns a list of files in the current directory that were modified today. Here is what I have:
Code:
#!/bin/bash
TODAY=$(date +"%b $d")
ls -n | grep -i "$TODAY"
This works great when the day is 10-31, but not if the day is between 1 and 9. For single digit days I have to change the script to add a space between %b and %d. I'm sure there is a better way to do what I'm trying to do here, thanks in advance!
PS. Running on a Pi.