what's the best way in shell to create custom date format and adding any space between the format?
For example the below command for print yesterday date by the format Oct 9
custom_format="$(date -d '-1 day' '+%b %-d')"; echo $custom_format
Now I need to add two spaces between the month and the day but usually not working with me, I tested also to using %t
to adding tap space but not working with this format.
custom_format="$(date -d '-1 day' '+%b **spaces here** %-d')"; echo $custom_format
date
command - see for example How do I echo a string with multiple spaces in bash “untouched”? – steeldriver Oct 10 '19 at 11:38