Using bash builtin printf '%(fmt)T', when fmt contains %-d (or %_d), there is no output - should print daynumber with no preceding 0 (or with preceding space). Similarly %-e. date +"%B %-d" works OK.

$ uname -a
CYGWIN_NT-10.0-19045 ASUS-X550C-WIN 3.5.1-1.x86_64 2024-02-27 11:54 UTC x86_64 Cygwin
$ bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-cygwin)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[0] ASUS-X550C-WIN!celvi:(pty0):Mon 01 Apr 2024 04:14 pm BST:/home/celvi
$ printf '%(%B %d)T\n'
April 01
[0] ASUS-X550C-WIN!celvi:(pty0):Mon 01 Apr 2024 04:15 pm BST:/home/celvi
$ printf '%(%B %-d)T\n'

[0] ASUS-X550C-WIN!celvi:(pty0):Mon 01 Apr 2024 04:15 pm BST:/home/celvi
$ printf '%(%B %_d)T\n'

[0] ASUS-X550C-WIN!celvi:(pty0):Mon 01 Apr 2024 04:19 pm BST:/home/celvi
$ printf '%(%B %e)T\n'
April  1
[0] ASUS-X550C-WIN!celvi:(pty0):Mon 01 Apr 2024 04:19 pm BST:/home/celvi
$ printf '%(%B %-e)T\n'

[0] ASUS-X550C-WIN!celvi:(pty0):Mon 01 Apr 2024 04:19 pm BST:/home/celvi

Works properly on Slackware current and LMDE6. Anyone any ideas?


Thanks




--

Chris Elvidge

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to