Join Scott Simpson for an in-depth discussion in this video Coloring and styling text, part of Learning Bash Scripting.
…You can style text in bash to draw attention to specific things.…Or just to make your output a little more interesting.…You can do this two ways.…The first way, is with ANSI escape codes.…For this, I'll use the echo command with…a dash lowercase e option to enable escape sequences.…The escape sequences I'll be using look like this.…Cool, but what the heck's going on here?…Let's take a look at this in a little bit more detail.…The first part, echo dash e, like I mentioned earlier tells echo that I'll…be using an escaped string, which are…special codes following a backslash or escape character.…
That lets me do the second part, the escape sequence, which is \033 and a…bracket to start, followed by a couple numbers with a semi colon in between them.…And that's all followed with a lowercase m,…to indicate the end of the escaped sequence.…The numbers represent various formatting options.…I'll talk about those in just a minute.…Then following that, I have the string that I'm…going to print out, in this case, Color Text.…
- What is Bash?
- Managing output with grep, awk, and cut
- Understanding Bash script syntax
- Creating a basic Bash script
- Displaying text with "echo"
- Working with numbers, strings, and arrays
- Reading and writing text files
- Working with loops
- Using functions
- Getting user input during execution
- Ensuring a response
Skill Level Beginner
Linux: Bash Shell and Scriptswith Kevin Dankwardt2h 46m Intermediate
1. Working with the Command Line
2. Building Bash Scripts
3. Control Structures
4. Interacting with the User
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.