To write simple output on the screen in a shell command or script under Linux and Unix, you can use the echo
command. The echo
command is a built-in command that is used to print text to the standard output (usually the screen).
Here is an example of using the echo
command to write simple output on the screen:
echo "Hello, World!"
This will print the message "Hello, World!" on the screen.
You can also use the echo
command to print the value of a variable. For example:
name="John" echo "Hello, $name!"
This will print the message "Hello, John!" on the screen.
You can also use the echo
command to print the output of a command. For example:
echo "Today is $(date)."
This will print the current date and time on the screen.