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" - 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
-
-
-
-
Understanding Bash script syntax5m 18s
-
(Locked)
Choosing a text editor for Bash scripting1m 33s
-
(Locked)
Displaying text with "echo"4m 26s
-
(Locked)
Working with variables5m 21s
-
(Locked)
Working with numbers8m 44s
-
(Locked)
Comparing values with test4m 59s
-
(Locked)
Comparing values with extended test3m 34s
-
(Locked)
Formatting and styling text output8m 13s
-
(Locked)
Formatting output with printf5m 6s
-
(Locked)
Working with arrays4m 25s
-
(Locked)
Challenge: Make a script that generates a system report1m 1s
-
(Locked)
Solution: Make a script that generates a system report1m 26s
-
-
-
-
-