Ana Sayfa / Linux / Bash Script / Avoiding date using printf

Avoiding date using printf

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.

Get the current date

$ printf '%(%F)T\n'
2016-08-17

Set variable to current time

$ printf -v now '%(%T)T'
$ echo "$now"
12:42:47

Bunada Göz Atın

Python Bitwise Operators

Bitwise operations alter binary strings at the bit level. These operations are incredibly basic and …

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir