help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printf %()T


From: Lee
Subject: Re: printf %()T
Date: Thu, 27 Apr 2023 23:51:25 -0400

On 4/27/23, Mike McClain <mike.junk.46@att.net> wrote:
>     Regarding a message Subject: alias not working, I'd like to thank
> Greg Wooledge and alex xmb ratchev for the tips to getting what I want.
>
>     In response to said message Greg Wooledge said, "The printf command
> can generate timestamps without needing to call date(1)."
>
>     I found in 'help printf' the same claim and in 'man 3 strftime'
> the format strings allowed but can't seem to find how to use that info.

what worked for me was 'man bash' and search for printf

>     I've tried many combinations but no joy.
>
>     Would someone please post a sample that works?

semi-working:

$ printf  "%(%A)T  %(%c)T" 1
Wednesday  Thu 27 Apr 2023 11:48:12 PM EDT

There's clearly a problem with the day of the week :(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]