How do I print a formatted system date + hostname using printf in bash.
Something like printf "%s:%s\n" date hostname?
printf "%s:%s\n" "$(date)" "$(hostname)"
printf "$(date):$(hostname)\n"printf(1)? For example: printf '%(%a %b %d %T %Z %Y)T:%s\n' -1 $(hostname)printf interprets escape sequences and format specifiers in the format string. If variables are included, any escape sequences or format specifiers in the data will be interpreted too, when you most likely wanted to treat it as data.". From github.com/koalaman/shellcheck/wiki/SC2059