Avoiding date using printf

suggest change

Versions

[{“Name”:“4.2”,“GroupName”:null},{“Name”:“4.3”,“GroupName”:null},{“Name”:“4.4”,“GroupName”:null}]

Introduction

In Bash 4.2, a shell built-in time conversion for printf was introduced: the format specification %(datefmt)T makes printf output the date-time string corresponding to the format string datefmt as understood by strftime.

Syntax

Remarks

Using printf -v foo '%(...)T' is identical to foo=$(date +'...') and saves a fork for the call to the external program date.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents