Skip to content
Advertisement

How to print a string AFTER the date in Linux Terminal?

I want to type a one-line command in Linux that will print the date followed by a string to the Terminal. For example, “… is today’s date.” This is what I tried.

JavaScript

However, this printed ” is today’s date. Sat Feb 20…”

I thought reversing the order would help, but this only printed the date.

JavaScript

Conversely, my third attempt only printed ” is today’s date.” without the date.

JavaScript

I am out of ideas. Short of multiple commands, using file input, or even paraphrasing it as “Today’s date is…” how can I get my desired output?

Advertisement

Answer

Try this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement