String Manipulation

In this lesson, you'll cover how to edit strings in bash, what extglobs are and how you can use them, and how to avoid common quoting problems with strings.

Since so much of working in bash is related to files and strings of text, the ability to manipulate strings is valuable.

While tools such as sed, awk, perl (and many others) are well worth learning, in this lesson I want to show you what is possible in bash - and it may be more than you think!

How Important is this Lesson?

This lesson is not essential. String manipulation in bash is only occasionally useful to know about, for example when the above-mentioned tools (sed, awk, perl et al) are not available.

The quoting tricks in this lesson are occasionally very useful, however.

String Length

One of the most common requirements when working with strings is to determine length:

Get hands-on with 1200+ tech skills courses.