Bash Avoiding date using printf Set variable to current time


Example

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