What command will return whatever value is given to it. For example, you would enter the command followed by the string Hello World and it will print Hello World to the console.
Does such a command exist, and what is it?
What command will return whatever value is given to it. For example, you would enter the command followed by the string Hello World and it will print Hello World to the console.
Does such a command exist, and what is it?
or
or (not for newbies):
Do you mean echoing?
prints
GoodMorning
In addition to the
echo
andprintf
shell builtins, if for some obscure reason you cannot use them, you also havecat
. If you combine it with Here Strings, you can have it print the input you give it:In fact, there are many commands that can do this if you twist their arm a little:
Most of the above (and the list if far from complete) are designed to do something with their input and here we are asking them to basically do nothing, so they print it unchanged.
This answer is mostly for illustrative purposes and is a bit tongue-in-cheek. In real life, just use
printf
orecho
, that's their job.