Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a log file in Linux that has a date Jul two spaces and a 9 for today.... tomorrow it will be Jul one space and 10. Everything I've tried: grep, date '+%b %-d', always return Jul with one space then 9. What can I do for a solution?

Replies are listed 'Best First'.
Re: space with date in log file
by choroba (Cardinal) on Jul 09, 2013 at 15:43 UTC
    The documentation of date says:
    _ (underscore) pad with spaces

    And really, it works:

    date '+%b %_d'
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ