I have a script that runs daily to add/commit/push to github. I'm trying to change the commit message to the size of the commit, which will always be only 1 file, in the format of <date>.html
.
I can reference the date using date "+%Y%m%d".html
, which returns a valid filename in the terminal. However, when I try to stat it using stat --printf="%s" date\ "+\%Y\%m\%d".html
, it returns the error stat: cannot stat ‘date +\\%Y\\%m\\%d.html’: No such file or directory
.
I understand that it is not executing my date as a command. How do I go about doing this?