- [Instructor] Hello again and welcome
to the last video of section four
Text Slicing and Parameter Operations.
In the previous video we learned about replacing
a pattern with text in all the files in a directory.
This section walks through
some of the simple text replacement techniques
and parameter expansion shorthands available in Bash.
A few simple techniques can often help us avoid
having to write multiple lines of code.
Let's get into the tasks.
Replacing some text from a variable
can be done as follows,
line is replaced with replaced.
We can produce a substring by specifying the start position
and string length by using the following syntax.
To print from the fifth character onwards
use the following command.
To print eight characters starting from the fifth character
use the following command.
The index is specified by counting the start letter as zero.
We can also specify
counting from the last letter as minus one.
It's used inside a parenthesis minus one,
is the index for the last letter.
Also in this video we've learned about text slicing
and parameter operations.
This video concludes the fourth section of this course.
We first learned about using regular expressions
and then we moved on to searching and mining text
inside a file with grep.
After that we've seen about cutting a file
column-wise with cut.
Then we moved on to using sed to perform text replacement.
Also we've seen how to use awk for advanced text processing.
Then we've learned about finding frequency of words
using in a given file.
We then learned about compressing
or decompressing JavaScript.
Also we've learned how to merge multiple files as columns.
Then we've seen about printing the nth word
or column in a file or line.
Then we looked at printing text
between line numbers or patterns.
We then moved on to printing lines in the reverse order.
Then we learned how to parse email addresses
and URLs from text.
We've also seen how to remove a sentence
in a file containing a word.
And then we moved on to replace a pattern with text
in all files in a directory.
Finally we've seen about text slicing
and parameter operations.
All the following videos in all the next sections
we will explore some recipes that can be used
to pass website content, download and obtain data,
send data to forms in order to make website usage tasks
and similar activities.
So the next section is Tangled Web? Not at all!