Reputation: 3327
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
Upvotes: 23
Views: 38207
Reputation: 16389
printf "%s:%s\n" "$(date)" "$(hostname)"
Upvotes: 42