From the course: Learning Bash Scripting

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Displaying text with "echo"

Displaying text with "echo" - Bash Tutorial

From the course: Learning Bash Scripting

Displaying text with "echo"

- [Instructor] One of the most basic commands or built-ins that we'll use in a Bash script is the echo command. Echo prints out information, normally to the standard output. But it can be directed elsewhere. The syntax for the echo command is pretty simple, you just type echo followed by whatever you want to output. We've already been using echo in the course so far to help us see the results of expansions and substitutions. But now let's take a more detailed look at echo, and explore how we'll use it in different ways to display text in a script. Echo is useful for outputting static text or variables or any value. And we can compose strings and variables and substitutions and expansions into one echo statement. So we can use programmatic output, right alongside static text. In Bash if I want to stick two pieces of text next to each other, I'll just write them one after the other. For example, I can write echo hello,…

Contents