From: Chris Elvidge <celvidge@outlook.com>
To: cygwin@cygwin.com
Subject: bash builtin printf date format problem
Date: Mon, 1 Apr 2024 16:28:28 +0100 [thread overview]
Message-ID: <AS4P194MB18164A9A59EFC2E3C8439FF4CF3F2@AS4P194MB1816.EURP194.PROD.OUTLOOK.COM> (raw)
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
next reply other threads:[~2024-04-01 15:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 15:28 Chris Elvidge [this message]
2024-04-01 17:45 ` Adam Dinwoodie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS4P194MB18164A9A59EFC2E3C8439FF4CF3F2@AS4P194MB1816.EURP194.PROD.OUTLOOK.COM \
--to=celvidge@outlook.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).